Count on last appearance of each type

Hi all,

Having this data:
Time type status
May 21, 2020 @ 11:40:48.345 A 1
May 21, 2020 @ 11:40:48.344 B 1
May 21, 2020 @ 11:40:48.344 C 0
May 21, 2020 @ 11:35:23.012 A 1
May 21, 2020 @ 11:35:23.012 B 0
May 21, 2020 @ 11:35:23.012 C 0
May 21, 2020 @ 11:30:32.345 A 1
May 21, 2020 @ 11:30:32.344 B 0
May 21, 2020 @ 11:30:32.344 C 0

My objective is to count the number of 1 in status field, but only in the last occurence of each type. So in this case 2.

I was trying to do it in TSVB Metric, with "Last value" in "Data timerange mode", set interval to 5m, but it does not seem to be working, which leads me to the question:

How the "Last value" works? I saw the:
Last value will match only the documents for the specified interval from the end of the time range. but not sure what it means in my case.

Is this possible to archive my goal?

Thanks for the help,

Well, seems to work fine after select the right timestamp field.

Thanks,

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.