List(1 , 2 , 3 , 3 , 4) - list(1 , 2 , 3 , 4) = list() <--blank?

I’m trying to find the duplicates of a list, this way I can base a special formatting rule off of it, but I’m running into the intelligence of the platform doing something I’m not wanting :laughing:

Like the title says, I have the following expression results:

list(1 , 2 , 3 , 3 , 4) - list(1 , 2 , 3 , 4) = list()

  • The first list has two 3s in there (that’s the duplicate I need to isolate out, and any others).
  • The second list is generated FROM the first list via UNIQUE()
    So I guess you could test: list(1 , 2 , 3 , 3 , 4) - UNIQUE(list(1 , 2 , 3 , 3 , 4))

I’m looking for the result: list(3) - because if I take things one-for-one that’s what I would get.

But AppSheet is an intelligent platform, and before a few months ago we didn’t have the UNIQUE() function, so (after tons and tons of bugging) the devs put in some auto-magic to make lists unique when you do any list-math on them.

But we have UNIQUE() now, so this behavior is actually a hindrance.


I was hoping that LIST() might tell the system, “Hey, take this list literally; subtract one from the other and don’t do any magic.”

But no. @Adam any suggestions? Thanks

Edit: Feature Request: DUPLICATES()??? :laughing: :nerd_face: NONUNIQUE()… THEREPEATINGONES(), DOPPELGANGERS(), CLONES()

2 Likes

+1 for a doppelgangers expression…

1 Like

Whenever an operator is used, a defined standard needs to be established. In many systems, there is ALSO an analogous function provided (e.g. SUBTRACT()) which allows variations based on parameter settings. The operator is really just a shorthand syntax for the most most common function usage.

It seems thats what is needed here, a SUBTRACT() or SUBTRACTLIST() function that allows for parameter (or two) to specify to remove/keep duplicates…and any other useful feature parameters!!

A DUPLICATES() function appears to be a specialized case of SUBTRACT().

3 Likes