I want to count values occurrences in value stream and store it in an infotable with two entries (value,count)
data in value stream = 1,1,2,2,3,3,
infotable count = (1,2) (2,2) (3,2)
How can I do it?
One possibility is to use the distinct function in the Infotables function resource to allow you to retrieve the ocurrences and write to a new infotable. Then run another service such as EQFilter to loop through the new infotable to count the occurrences. This could potentially be an intensive task depending on the size of the value stream. Recommend testing in Dev before migrating to Prod.
If one of the previous responses helped you to find a solution, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.
It actually looks like a job interview question to me.
If we don't know the range of the value in the VS, we cannot use a filter to scan the infotable for unpredictable times, we need to take the VS data as incoming data stream, writing to an infotable with shape [Value; count]. If it's a new value, add a row to the infotable and set count to 1, if it's an exisiting value, add number to the count.