Custom average for unique records


#1

HI guys,
I'm trying to figure out if there's a way to customize the average of my visualizes
I.e, I want the average for the unique records and not the average for all records

1,2,3,4,5,6,7,8,8,9
The average will refer to 8 numbers due to the fact that 8 appears twice

Any idea how to do this using Kibana's features?

10x in advance


(Stacey Gammon) #2

Just to clarify, the value you want to retrieve from, say, [1, 7, 7, 10] is 5 because 7 is completely removed due to the fact that it appeared twice? Or are you looking for the number 6, because only the unique numbers are counted, and 7 is still included once? I believe you are looking for the former.

Though either way, the only way I can think of accomplishing this is by adjusting your data ingestion to add a field that tracks only numbers that are not duplicates, then you could use the normal average calculation on that field.

You can use a data table visualization to view unique values for a field, and export that data and run calculations externally on it, but I'm not aware of a way to use those unique numbers in a visualization inside Kibana.


#3

Tnx @Stacey_Gammon for response
I actually meant to the 2nd - count unique numbers too :smirk:
For your 1st suggestion, you actually mean to index my data in ES with unique/ custom field?
Does single parameter is enough?
e.g.

1,2,3,4,5,6,7,8,8,9
1st parameter goes for number of unique values (8) and 2nd parameter goes for the total count of unique nubmers (45)

Else how the normal average will perform proper calculation ?


(Felix Stürmer) #4

Hi @avivc,

which version of Kibana are you using and what type of visualization are you trying to create (metric, bar chart, table, ...)?


#5

Hi @weltenwort
Running Kibana Version: 5.1.2 and the visualization is line chart.


(Felix Stürmer) #6

Please correct me if I misunderstand your requirements, but that sounds like a line chart with the average aggregation as the y-axis metric and a terms aggregation as the x-axis metric on the field with unique values should do the trick. Unless there's another aggregation already on the x-axis...?


#7

Hi @weltenwort
I'm checking your input
Tnx


(system) #8

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