Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using a KPI what I need is a performance optimization for that KPI. So there is formula that is being repeated more often so is there way I can set that formula in load editor and use it dynamically in my KPI. Like when using that variable it should change when filters are applied.
As an example, let's assume an expression like:
Sum({<Year-{$(=Max(Year))}>}Sales)
If you try script:
SET vSales = Sum({<Year-{$(=Max(Year))}>}Sales);
The script will attempt to evaluate Max(Year) and the variable will be incomplete. Instead, break up the $( in your script like this:
LET vSales = 'Sum({<Year-{' & '$(=Max(Year))}>}Sales)';
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
You can create the expression in a variable, for example in script:
SET vSales = Sum(Sales);
And then reference the variable in charts as:
$(vSales)
Note that there is some tweaking that needs to be made in the script if your expression contains $(.
-Rob
It does contain $ ..so what should be done ?
Please help me. I am new to Qliksense
The dollar sign expansion ($); returns the value of the variable instead of its name.
See here: Dollar-sign expansion using a variable
As an example, let's assume an expression like:
Sum({<Year-{$(=Max(Year))}>}Sales)
If you try script:
SET vSales = Sum({<Year-{$(=Max(Year))}>}Sales);
The script will attempt to evaluate Max(Year) and the variable will be incomplete. Instead, break up the $( in your script like this:
LET vSales = 'Sum({<Year-{' & '$(=Max(Year))}>}Sales)';
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
@rwunderlich @BrunPierre Thank you For helping out. . Thanks much !