Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
eirikmagnussena
Contributor
Contributor

Qlikview Variables referencing variables does not work after upgrading to QV12 (from QV11)

I've just today upgraded my production environment to QW12.30 SR1

After this installation I have a few calculated KPIs that do no longer work.

I've found that the problem occurs only with calculations that are set as variables in the load script and reference other variables.


e.g this kpi would work (if expression in cell would be something like "=$(kpi.PnL('A'))"
-------------------------------
let string.KPI-1= 'if(left($1, 1) = ''A'',
sum({<[Amount type code]={$1}, [KPI ID]={''BI-1''},[Source]= {''Actuals''}>} [Amount]),
sum({<[Amount type code]={$1}, [KPI ID]={''BI-1''},[Source]= {''NotActuals''} >} [Amount])
)';
let kpi.KPI= '=num#(replace(string.KPI, ''~'', ''$''))';
--------------------------------

while this one would not:

-------------------------------
let string.KPI-2 = 'num#(~(kpi.KPI1($1))) * 0.67 ';
let kpi.KPI-2= '=num#(replace(string.KPI-2, ''~'', ''$''))';
--------------------------------

These are not my actual KPIs offcourse, I've shortened them for easier readability here.

All of the KPIs function without issue in QV11, so I guess my question is along the lines of:
Are there any changes in how variables are being handled from QV11 to QV12 that would cause this issue?
If so. Will someone help me understand how to rewrite these variables to actually work?

1 Solution

Accepted Solutions
eirikmagnussena
Contributor
Contributor
Author

Hi Marcus!

You solved my problem!

Thanks! This was really helpful. My main projects are with the MS stack, so unfortunately I'm not as up and running on the true differences/changes in different versions of Qlikview as I would like to.

I rewrote the expression variables in the variable overview with double-quotes instead of singles, and it worked first try! 

I will definitely go back to using variable overview as the source of variables. I've externalized this in a document outside of the app, because I thought it would be an easier way of deploying the same kpis to different apps. But I think I'll keep them in-app only now!

View solution in original post

2 Replies
marcus_sommer

I don't know if there was any change within the variable-handling between the releases but I assume rather not because I don't remember to see any issues here in the community.

What has changed (I believe it came with 12.2) is the meaning of quotes within set analysis (and maybe in a few other features, too) so that single-quotes around any value don't are valid anymore to define a search-string (it was a bug) else the content will be only treated as strings.

This might cause your issues and could be adjusted with a system-variable (currently I don't know the name) within the document and/or the settings.ini to remain by the old handling or use the new one or the app-creation date defines which setting should be applied. But AFAIK this choice will be removed again with one of the future releases - to remain by the old handling is just saving some time before the hard break comes.

Beside this I wouldn't use this way to define (complex expression) variables. Either I would do it within the variable-editor or I would load them from a table and picking the variables from there within a loop. The reason for it is that it would avoid the efforts to handle the various quotes-stuff and/or the replacing-approaches of them and the $-signs. Within the following post you will find various examples for it: Variables.

- Marcus

eirikmagnussena
Contributor
Contributor
Author

Hi Marcus!

You solved my problem!

Thanks! This was really helpful. My main projects are with the MS stack, so unfortunately I'm not as up and running on the true differences/changes in different versions of Qlikview as I would like to.

I rewrote the expression variables in the variable overview with double-quotes instead of singles, and it worked first try! 

I will definitely go back to using variable overview as the source of variables. I've externalized this in a document outside of the app, because I thought it would be an easier way of deploying the same kpis to different apps. But I think I'll keep them in-app only now!