-
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] Formula: References #94608
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
I assume from the context that we would limit references to visible dimensions only, not hidden functions like the count that's inside of a cumulative sum? The only concern I have is the potential for circular references. We need to prevent users from building formulas that reference each other. |
Yes, this is about visible dimensions only. Checking for circular references is a real problem and checking for them has to become part of the validation logic. If there are some, the chart fails to render. |
In order to provide better transparency of priorities, issues that will not be prioritized within the next 24 months are being closed. Tracking request in Lens general improvements ice box, solvable possibly with ESQL #184648 |
For various things it would be to nice to reference other columns of the current table in a formula.
Implementation
Technically it's very easy to read a value from another column as the formula is executed per row and it's only necessary to know the column id, but as it's a UUID this would be a very unintuitive for the user to type directly.
Instead, we could add a
reference(<string argument>)
function which resolves the reference at parsing time (as soon as the user submits the formula).5 + reference("The other number column")
reference
nodea3b2fc
)5 + reference(a3b2fc)
5 + a3b2fc
a3b2fc
is mentioned in the list of references of the math operationIf the user opens the editor later
5 + reference(a3b2fc)
reference
function callIf the referenced column is deleted, an error can be shown the user because the references are not consistent anymore.
The column label of the referenced column can change, but the formula will stay functional
Use case
The text was updated successfully, but these errors were encountered: