i have two problems with the top N function in the TSVB.
Problem1: If I use "Group by" Terms and i set the value of Top to for example 50, but i only have 30 different terms, than the TopN function doesn't work.
Problem2: For example i use "top = 5" then i get data like this:
M05 30°C
M01 28°C
M03 26°C
M04 20°C
M02 18°C
perfekt! But when i decrease the top value to for example "top = 4", it should just "delete" the last entry (M02 18°C), but it deletes M04, which doesn't make sense.
I understand why you might not expect this behavior, it is different from how non-Elasticsearch products work. I will both explain why you are seeing these numbers and tell you two workarounds you can use. The workarounds won't make sense unless I provide the explanation first.
The way TSVB works is that it uses a Terms aggregation first, before splitting into your Date Histogram buckets. So when you are seeing "Top 5", it is ranked based on the Top 5 for your entire time range, which means that you'll see the same 5 series in each time bucket. Secondly, the default behavior of the Top N in TSVB is to use only the last bucket from your date histogram.
In TSVB, you can switch to Entire time range mode instead of Last value mode. This will make the Terms aggregation behave more like what you are describing.
Thanks for your answer.
The reason i use the Top N in TSVB is because I need the Tiny-math function and as far as I know, only the tsvb allows to make simple calculations.
I see, so you might be able to use the Entire Time Range workaround that I suggested.
If that doesn't work, you will have to read our reference documentation to choose the right editor. In 7.13, the right editor might be Vega. In 7.14, Lens will offer "Formulas" which are more powerful than TSVB.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.