Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
In an application, I often use a piece of code in a set analysis which is quite long. is there a way to store it in kind of a variable so I don't have to write it each time ?
Thank you
Laura
Yes, that's a very good idea. Here's an example:
original:
expression: sum({<FieldA={'Something'},FieldB={'>100'}>+<FieldC={'=sum(Sales)<1000'}>}Sales)
using a variable:
variable: vSetMod: {<FieldA={'Something'},FieldB={'>100'}>+<FieldC={'=sum(Sales)<1000'}>}
expression: sum( $(vSetMod) Sales)
You can of course also store parts the complete set modifier into different variables and combine those in the expression or in yet another variable. Variables can even take parameters:
vSetMod: {<FieldA={$1}>)
sum( $(vSetmod('Something')) Sales)
Yes, that's a very good idea. Here's an example:
original:
expression: sum({<FieldA={'Something'},FieldB={'>100'}>+<FieldC={'=sum(Sales)<1000'}>}Sales)
using a variable:
variable: vSetMod: {<FieldA={'Something'},FieldB={'>100'}>+<FieldC={'=sum(Sales)<1000'}>}
expression: sum( $(vSetMod) Sales)
You can of course also store parts the complete set modifier into different variables and combine those in the expression or in yet another variable. Variables can even take parameters:
vSetMod: {<FieldA={$1}>)
sum( $(vSetmod('Something')) Sales)
Hi Laura,
in principle, that is possible, no problem. You can use variables in a set_analysis - I have tried only with "simple" numeric values which don't require that expansion thingy, but I guess it should be possible with those, too.
HTH
Best regards,
DataNibbler
thank you Gysbert
Have a good day !