Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
tauceef
Partner - Contributor III
Partner - Contributor III

variables within variables in load script

Hello Everyone,

I am having issues defining variables in load script.

Referring this post variables within variables in load script I defined variables like below:

Set Month_L3M=AddMonths(Max(Month_Year),-3);

Let v3Months=Replace('Aggr(only({<Month_Year={">=@(Month_L3M)"}>}WeekYear), WeekYear)', '@', Chr(36)); //Double quates in the filter condition

OR

Let v3Months=Replace('Aggr(if(Num(Month_Year)>''@(Month_L3M)'',WeekYear),WeekYear)', '@', Chr(36));  // 2 single quotes in the if condition

but both of the above are not working for me. I have tried both Let and Set but nothing works. Any help would be great. Thanks.

Regards,

Tauceef

Labels (1)
1 Solution

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

Maybe you are missing an equal sign

Let v3Months=Replace('Aggr(only({<Month_Year={">=@(=Month_L3M)"}>}WeekYear), WeekYear)', '@', Chr(36)); //Double quates in the filter condition

View solution in original post

2 Replies
lorenzoconforti
Specialist II
Specialist II

Maybe you are missing an equal sign

Let v3Months=Replace('Aggr(only({<Month_Year={">=@(=Month_L3M)"}>}WeekYear), WeekYear)', '@', Chr(36)); //Double quates in the filter condition

tauceef
Partner - Contributor III
Partner - Contributor III
Author

Hi Lorenz,

Thank you for your prompt response. That really helps, I have updated my script to below and it works. Just that I have to use 2 single quotes instead of double quotes and it is working with If condition only:

Replace('aggr(if(Num(Month_Year)>''@(=Month_L3M)'',WeekYear),[WeekYear])','@',chr(36));

Regards,

Tauceef