How to constrain sum metrics based on value of a count metric

Got a table visualization bucktizing on two Term fields and then doing various split Metrics on other fields.
Wondering if I might be able to filter out documents with 2. bucktize term seen more than once from other sum metrics, maybe through the Adv. JSON Input or otherwise or need I to dig into TimeLion maybe?

42

Would like to calc sum of other columns with #metrics = 1 (#metrics is the 3. column, bucktized on 1. and 2. column)

Hi @stefws
sorry for the late reply. Have you already solved that issue?

If not can you provide me an example of output you want from the shared screenshot above?

Well sort of, wanted to filter out only rows where 3.column = 1 then calc total sum of columns 4. & 5.
Believe this could be done with '{ "max_doc_count": 1 }' in adv. Json input of 3. column?
But haven't tried it yet as mean time our BI people continued scrambling in their PowerBI&SQL :slight_smile:

Unfortunately there is no max_doc_count as also described here: https://github.com/elastic/elasticsearch/issues/21714

You could try with TSVB, but the only issue here is that you cannot group data by multiple fields (depends on your usecase, you can maybe reindex your data creating an field that crate an unique ID for these two fields)

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