TSVB Aggregation Count Filters

Hello

I want to be be able to perform a math aggregation that will divide variable A by B.

Variable A: I want to be able to use the count aggregation but filter by only the documents that have a certain field, I've looked at filter ratio for this but I'm not sure if this would work for this as both a numerator and denominator field will only provide a decimal value and not the actual count of the records.

Variable B: This will just be a regular sum aggregation.

I may be missing something but would be good to hear suggestions for this to get the filtered count value for variable A :slight_smile:

Im able to perform this calculation in the lens formula section using:

count(kql='event.name: "value.a"')/sum(field.b)

1 Like