Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YeartoDate PY with 53 weeks

Hi all,

Our definition is that for YearToDate (YTD) we take max 52 weeks. Normally we defined PastYear YTD (PYYTD) as Commercialyear -1 and took the same (max) week. Now we've changed our formula and it works fine directly in the expression. But we work with include variable files (.txt). If I place the variable in the file it doesn't work anymore. THe only change to the expression is that in the variable we need to use the ALT codes.

Can you please help me?

LET vNetSalesPYYTD = 'sum({<CommercialYear=,Week=,WeekSerial={">='&CHR(36)&'(=max(WeekSerial-if(Week='53', 52, 52+Week-1))),<='&CHR(36)&'(=max(WeekSerial-52))"}>}Sales)';

Best regards,

Astrid

1 Solution

Accepted Solutions
Not applicable
Author

I've found the solution:

LET vNetSalesPYYTD = 'sum({<CommercialYear=,Week=,WeekSerial={">='&CHR(36)&'(=max(WeekSerial-if(Week="53", 52, 52+Week-1))),<='&CHR(36)&'(=max(WeekSerial-52))"}>}Sales)';

so it was " in stead off '

View solution in original post

1 Reply
Not applicable
Author

I've found the solution:

LET vNetSalesPYYTD = 'sum({<CommercialYear=,Week=,WeekSerial={">='&CHR(36)&'(=max(WeekSerial-if(Week="53", 52, 52+Week-1))),<='&CHR(36)&'(=max(WeekSerial-52))"}>}Sales)';

so it was " in stead off '