Count and unique count

i want a metric visualisation that finds the difference of count and unique count that is to get the count of duplicates in an index

You can use Visual Builder to show the amount of duplicates by bucket. So the metric will show the amount of duplicates in the latest time interval.

If you want to show a total number of duplicates, the accurate way would be to increase the bucket so much that it basically contains all the data.

If you try and do cumulative sum of count and cumulative sum of unique values with regular sized buckets, the count will be accurate, but the unique values will begin to go out of sync from the first time you move to the next bucket so that is not a solution.


Hi, I have the same question and I tried to use Visual Builder as you suggested here however I get a error message saying "Unknown variable: params.count-params.unique_count" as soon as I choose the field 'Count' in the second box on the right under the Variables. What do I do wrong?

Do them in order, so write the expression last. It's because TSVB is set to auto-run and it will try an run before all the variables are set

Thank you Marius!

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