Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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)';
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)';
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.