-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Lens] Global filter for formula #103246
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
Can variables be added to the Formula? For example: |
@dminovski0 variables/references in formula can be tracked here: #94608 |
Right now it's not possible to specify a filter on a whole formula dimension like it's possible for regular operations.
This is not limiting functionality because it possible to define a filter per metric within the formula, e.g.
count(kql="fieldA: 123")
. However there are some common use cases which require multiple metrics using the same filter in all places which quickly becomes annoying because it requires the user to type the same filter multiple times (like percentage of total):count(kql='my_complex_filter: 123 AND field2 < 34.2') / overall_sum(count(kql='my_complex_filter: 123 AND field2 < 34.2'))
For these cases it would be beneficial to be able to define a filter on the formula itself which is merged into all filters defined per metric used in the formula:
count() / overall_sum(count())
my_complex_filter: 123 AND field2 < 34.2
count
metrics within the formula - equivalent tocount(kql='my_complex_filter: 123 AND field2 < 34.2') / overall_sum(count(kql='my_complex_filter: 123 AND field2 < 34.2'))
This gets more complex in case of filters defined in the formula:
count(kql='fieldA > 12') / count()
fieldB: "ABC"
count(kql='fieldB: "ABC" AND fieldA > 12') / count(kql='fieldB: "ABC"')
If all queries are defined as kql or all queries are defined as lucene, they can be merged in a very simple way:
(${query1}) AND (${query2})
There is one case where this wouldn't work as straightforward - if lucene and KQL queries are mixed this way. There are two ways how this case could be treated:
IMHO we should show an error message for the case - it introduces additional complexity and I think this case is extremely rare in practice.
The text was updated successfully, but these errors were encountered: