cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to count values occurrences in value stream?

PB_9026895
Participant

How to count values occurrences in value stream?

Hi all,

I want to count values occurrences in value stream and store it in an infotable with two entries (value,count)

Example :

data in value stream = 1,1,2,2,3,3,

infotable count = (1,2) (2,2) (3,2)

How can I do it?

Thanks

3 REPLIES 3

Re: How to count values occurrences in value stream?

Hi @PB_9026895.

 

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.

 

Regards.

 

--Sharon

Re: How to count values occurrences in value stream?

Hi @PB_9026895.

 

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.

 

Regards.

 

--Sharon

Re: How to count values occurrences in value stream?

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.

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.