Counting in/through Collections

matuopm

Member
I have a collection with 2 text fields

VTPalt and VTPName

The collection is a JSON extract/import and can have up to 100 rows of data.I need to know an elegant way to count how many unique VTPalt entries there are and note that number in an extra dataitem.

Example:
15616 -> 1
41861 -> 2
41641 -> 3
41641 -> double does not count
14684 -> 4
41641 -> double does not count
16581 -> 5
16186 -> 6
111111 -> 7

Anyone got an idea
 

Pete_L

Active Member
Filter the collection using a SQL SELECT DISTINCT statement and output the results to a new collection. The new collection will contain only unique values.
 

matuopm

Member
Could you also help me out with the syntax of it ? Somehow i can't get it to work the way I do it. I tried several things so far but none worked so
syntaxquestion.png
 

sahil_raina_91

Active Member
Create a new action in Collection Manipulation VBO.

Input : Collection_In
Output : Collection_Out
Code : Collection_Out = Collection_In.DefaultView.ToTable(true, "VTPalt")

This will return unique values in Collection_Out. Count the rows and you should be good.
 
Top