Getting unique items from List

I am trying to get unique items from 3 different list. Just like below.LIST
Seeking for help as I am stucked in middle of something.

Mitesh

See here:
http://dictionary.dynamobim.com/#/Core/List/Action/UniqueItems

That finds unique items from one list and reduces further more. I need to find unique ones from 3 different lists without reducing items in list.

Your example looks more like you want to get the maximum item of each list.

Its more like removing duplicate numbers from list and find unique ones. If you look closely each row of list contains duplicate numbers. I need to eliminate it. doesn’t matter if my final result is higher or lower numbers.

In that case you can use GroupByKey on each sublist and then pick those items that have a List.Count of 1.

@Nick_Boyts This is what I am getting

@Andreas_Dieckmann, Would you mind if you can show me how to do this as I am very bad a managing lists?

@Nick_Boyts, Set “List.UniqueItems” lacing to longest. No luck.

Forget what I’m saying. I don’t know what I’m thinking right now.
Follow @Andreas_Dieckmann’s idea for getting the item with a List.Count of 1.

These 3 nodes should do what you need:

  • List.CountOccurences (Clockwork)
  • ==
  • List.FilterByBoolMask
5 Likes

Thanks Mate!

This trick worked and generated the list which I want.

Thanks to all of for help!

Mitesh

paste this code into python script:

import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import collections

#Assign your output to the OUT variable.
OUT = [[item for item, count in collections.Counter(i).items() if count == 1] for i in IN[0]]
1 Like