Forum Academy Marketplace Showcase Pricing Features

How to subtract a list from another list?

Hey! I have two separate types.

  • Roster

        - member ID #1, member ID #2, etc
    
  • Active

        - member ID #1, member #3, etc
    

Which have members, which is a list of numbers, separated by commas.

I want my output list to be unique and only show unique users that appear on the Roster type, but do NOT show up on the active list:

I’m trying to select UNIQUE elements only when I combine these lists. However, these items do not merge and filter out when instructed to ‘merge’ and :find unique.

Additionally, I have tried using intersect, filtered properties, and many other methods, including minus list. None work.

This is killing me and I’ve spent ALL day on it. Any help would be awesome!

1 Like

Use List one:minus list List two:unique elements

In the image you can see the two list in the RGs above and the result in the RG below:


image

1 Like

I have tried using this mentioned method and it doesn’t result in the outcome I’m looking for. How odd.

My data is taken from an API call and directly put into my DB. (That would be both lists are from separate API calls). Could this be a reason it isn’t working?

@cameron1

Try converting them to objects instead of numbers

Would this just be ‘convert to text’, or what’s the best way to do this?

Make sure the data is stored as the same type, numbers or text.

If the data comes from an API response, initialize the call and choose the right type.

I can confirm that the data from both APIs that I’m trying to compare are already both numbers. There is no difference. I just reinitialized my call to discover just that,

Could you share a screenshot of the lists operation expresion?

Sure!

image

image

This shows you how I’m doing it, hope this helps.

I’d try puting the two searches as the data source of two groups and then make the operations with the groups, so you are sure that the sources are always the same.

Do it and check the lists and the substraction.

And in the substraction you need to add :unique elements.

Now, this makes sense but I want this to perform on the backend. This is only being done with groups so I can actually visualize what’s going on.

The real issue is that often times my API call won’t have any data associated with it.

On one call I pass in unique users to get their stats - if a user has no stats, the call seems to skip over the user entirely.

I want it to be where if a user isn’t scanned, or has a metric < 0, to update that user’s ‘daily’ value to reflect 0. I have tried many methods of forcing this data to appear, but to no avail, hence the reason I’m not using two lists to determine the users that are not active.

What would be the best way to perform this in a workflow?

Sorry for the troubles, but thanks for giving it a guess!!