count values in timeseries list - Mendix Forum

count values in timeseries list


hello everyone,

I have a microflow which is doing a RESTcall and returns a time series list for the attribute  XY of an entity.

The attribute XY can only have the values 1,2 or 3.

I know want to count the number of each value and display that next to the timeseries in a pie chart.

Can somebody tell me how to do that?


best regards!

2 answers

Hey Thorsten,

thank you for your help!

But is it possible to use the same microflow which returns the list for the ‘time series widget’ ?
Or do I have to create a new microflow?


best regards


Since your attribute can only have 3 distinct values, an easy solution would be to first filter for each value, then count. Filtering a list can be done by using the microflow activity “List operation” with operation “Filter” which will return a list filtered by an attribute value (e.g. all records where xy=1). Do this three times to get all sub-lists for xy = 1, 2 and 3. Then you can use the microflow activity “Aggregate list” with Function “Count” (for each sublist you will have to do one count).