Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
reivax31
Partner - Creator III
Partner - Creator III

Date variable and measure declared in script

Hi Qlikers,

I'm trying to find a way to put measures in the script. This way it's easier to change expression instead of having to change each principal measure one by one or each variable one by one in the variable console.

Also I would like that this measures reacts depending on my date selecting in a variable. 

Please find attached the .qvf to have the proper exemple. How should I write my variables vSummaryDate so that it is properly displayed.

Thanks for your support

Labels (2)
1 Solution

Accepted Solutions
reivax31
Partner - Creator III
Partner - Creator III
Author

I found the solution using this:

 

LET vSummaryDate = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate1 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate1)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate2 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate2)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate3 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate3)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate4 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate4)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate5 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate5)'&chr(39)&'}>}STATUS_1MONTH)';

View solution in original post

3 Replies
miskinmaz
Creator III
Creator III

Instead of trying to add measures you can try to add the same measures in master visualization

 

reivax31
Partner - Creator III
Partner - Creator III
Author

If I add in master visualization or master measures then I will have to change it one by one the day the calculation rules changes. It's easier in the script to perform replaces

reivax31
Partner - Creator III
Partner - Creator III
Author

I found the solution using this:

 

LET vSummaryDate = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate1 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate1)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate2 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate2)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate3 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate3)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate4 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate4)'&chr(39)&'}>}STATUS_1MONTH)';
LET vSummaryDate5 = 'ONLY({<MEASURE_DATE={'&chr(39)&'$'&'(vCurrentDate5)'&chr(39)&'}>}STATUS_1MONTH)';