syunusic
(Sacha Yunusic)
November 11, 2024, 6:58pm
1
If I have a Legacy Metric with this formula:
sum(data.bills)/(sum(data.sales)
And I want to add a filter like this:
{ "match_phrase": { "data.style": "Lease" } }
But the documents that have the field data.sales never have the field data.style, so, when I apply the filter, shows no result.
Is there any way to "tell" Lens to apply that filter to the numerator (sum(data.bills)) and not to the denominator?
bhavyarm
(Bhavya R M)
November 12, 2024, 7:18pm
2
I wonder if you can add a runtime field for "data.style" in to documents and solve this problem?
Thanks,
Bhavya
syunusic
(Sacha Yunusic)
December 4, 2024, 4:33pm
3
At the end I did it with KQL filter in the actual formula.. something like this:
sum(data.bills,kql='data.style: "Lease"')/(sum(data.sales)```
And works perfectly.