Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load Variables in Version 12.0

I just recently installed a version 12.0.2 on an another PC and have run into a problem with importing variables.

During my load script I load a couple of variables, but they get changed during the import process. In Version 11.20.12904 it works just fine.

How can I get this to work in the new version?

The actual problem is as follows:

Definition of variable: SET vAvailSK  = '=SUM({$<Week={"$(vCurrentWeek)"}>} (CapY + CapC + CapF)*Distance)';

Definition of variable: SET vCurrentWeek = '=Week(Date(Now()))':

Import in Version 11.20: =SUM({$<Week={"$(vCurrentWeek)"}>} (CapY + CapC + CapF)*Distance)

Import in Version 12.0.2: =SUM({$<Week={"=Week(Date(Now()))"}>} (CapY + CapC + CapF)*Distance)

For some reason, the "imported" version in 12.0.2. results in a different, wrong value, while the original version of the variable calculates the proper value.

How to stop Qlikview to replace the variable name with the variable content during the import?

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I can't reproduce the behaviour you're talking about. As far as I know Qlikview has always dollar expanded variables in the script.

There are dozens of discussions on this site from people falling in that particular pit. The solution is one of these:

SET vCurrentWeek = '=Week(Now())';

SET vAvailSK  = '=SUM({$<Week={"@(vCurrentWeek)"}>} (CapY + CapC + CapF)*Distance)';

LET vAvailSK  = Replace($(vAvailSK),'@','$');


SET vCurrentWeek = '=Week(Now())';

LET vAvailSK  = '=SUM({$<Week={"$' & '(vCurrentWeek)"}>} (CapY + CapC + CapF)*Distance)';



talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I can't reproduce the behaviour you're talking about. As far as I know Qlikview has always dollar expanded variables in the script.

There are dozens of discussions on this site from people falling in that particular pit. The solution is one of these:

SET vCurrentWeek = '=Week(Now())';

SET vAvailSK  = '=SUM({$<Week={"@(vCurrentWeek)"}>} (CapY + CapC + CapF)*Distance)';

LET vAvailSK  = Replace($(vAvailSK),'@','$');


SET vCurrentWeek = '=Week(Now())';

LET vAvailSK  = '=SUM({$<Week={"$' & '(vCurrentWeek)"}>} (CapY + CapC + CapF)*Distance)';



talk is cheap, supply exceeds demand
Not applicable
Author

Thanks. I used the

LET vAvailSK  = '=SUM({$<Week={"$' & '(vCurrentWeek)"}>} (CapY + CapC + CapF)*Distance)';


version and this works. I'm a bit puzzled though, that in Version 11.2 it is importing it correctly. But at least it's working on the newer version now.