Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

wnorwood
New Contributor III

Save Set Analysis expression with variable inside a variable

Hello,

I need to able to save the script for my Set Analysis into a variable during my Load that can be used in an Expression in a chart.  This works great except that it resolves the variable that is inside the Set Analysis and stores that value -- I need it to keep the text of the string. The variable gets set using actions when new values are selected from a multi-box object, so I need it to reflect that new value on the fly.

I have tried several combinations of SET and LET, single quotes and double quotes, and even tried concatenation of the $.  Does anyone have a solution to this dilemma?

Below is a sample of my Load script.  $(vMaxCounterRollingMonth) is the variable that it is resolving.

vMonthly = {$<[Period Counter Rolling Month]={$(vMaxCounterRollingMonth)},[Period Month]=,[Period Quarter]=,[Period Month Year]=,[Period Year]=>}

I am working in QlikView 12.

Thanks!

1 Solution

Accepted Solutions
MVP
MVP

Re: Save Set Analysis expression with variable inside a variable

LET vMonthly = '{<[Period Counter Rolling Month]={' & '$' & '(vMaxCounterRollingMonth)},[Period Month]=,[Period Quarter]=,[Period Year]=>}';

Will prevent the $-sign expansion from being done in the load script. vMonthly will have the literal text of:


{<[Period Counter Rolling Month]={$(vMaxCounterRollingMonth)},[Period Month]=,[Period Quarter]=,[Period Year]=>}



4 Replies
MVP
MVP

Re: Save Set Analysis expression with variable inside a variable

LET vMonthly = '{<[Period Counter Rolling Month]={' & '$' & '(vMaxCounterRollingMonth)},[Period Month]=,[Period Quarter]=,[Period Year]=>}';

Will prevent the $-sign expansion from being done in the load script. vMonthly will have the literal text of:


{<[Period Counter Rolling Month]={$(vMaxCounterRollingMonth)},[Period Month]=,[Period Quarter]=,[Period Year]=>}



Highlighted
wnorwood
New Contributor III

Re: Save Set Analysis expression with variable inside a variable

Thank you so much! Works perfectly!

MVP
MVP

Re: Save Set Analysis expression with variable inside a variable

Could you please mark the answer as "Answered" and/or "Helpful" please to close the thread.

wnorwood
New Contributor III

Re: Save Set Analysis expression with variable inside a variable

Done and done! Thanks again!