Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, sometimes expressions get really exhaustive. Is it possible for better readability to create a temporary variable which is only valid for this expression?
Hi,
Yes this is possible. Do this in your script so that they don't get deleted.
Example:
let eSumSales = 'Sum(Sales)';
In chart:
$(eSumSales)
This will now evaluate your variable, Sum(Sales). Of course these can be a lot bigger than the example.
Jordy
Climber
No, it's not possible. There is only one way to create a temporary (adhoc) variable with $(= ...) but they are executed once one the place where they are created and you could not reference on them.
Beside this you could use variables to store complete expressions and/or parts of them. Also you could use variables with parameter like: var: sum({< $1 = {$2}>} $3) and call them with: $(var(Field1, 'abc', Field2)). Further there are various possibilities to shorten expressions by replacing nested if-loops and similar constructs with pick(match()) or alt() or range-functions and probably some more.
Another possibility might occur in objects in which expressions are related to eachother. Here you could refer on them through the expression-label or the column-index like: column(1).
But the base of all this is a suitable datamodel. All or at least the most complex matchings and calculations which are not depending on selections should be flagged and/or (pre-)calculated. Everything left on this side will be require more or less efforts within the UI.
- Marcus