Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Furthermore it will persist in any copies of the App you make, even after you have made the deletion. ie Duplicating the App above, after deleting v2 will produce the same result.
Currently testing on June 2019 release of qliksenseserver : 13.32.2
All the best
David
To clear variable:
SET v1=;
SET v2=;
If you create a variable in the script
Set var1 = 'Abc';
it will be available in the variable overview in the design edit mode.
If you later remove the row
//Set var1 = 'Abc';
The variable will still be available with the value 'ABC', but you can manually edit it in the variable overview in the design mode.
If you in the script instead empty the content of the variable, the variable will be available in the variable overview, but with no value.
Set var1 = ;
To keep an variable from appearing in the variable overview at all you need to always empty the content of the variable before the script ends. The var2 below will not end up in the variable overview and not be available during the next reload.
Set var2 = 'Xyz.qvd';
Load * from '$(var2)' (qvd);
Set var2 = ;
sorry - you're missing the point. What I'm saying is that the variable seems to disappear, but the during the execution of the script any reference to it (even though it is no longer there) will return the value it had before you deleted it.
This can lead to some very odd behaviour in scripts!!!
I've just simplified it down as far as possible to highlight what appears to be a pretty serious bug!
Dave
Your comments have alerted me to something though - the variable still seems to exist in the App, even though it is no longer in the script. As you can see in the screenshot below, v2 is no longer a script variable, but it is still there 😐
What do you mean when you write that "the variable seems to disappear"? What actions did you do to make it disappear?
PS: If the variable is available in the app then it is also available in the script. DS
Try this and see if you still get the var2 value in the second iteration.
set v1 = 'variable 1';
set v2 = 'variable 2';
LET v3 = v1 & ','& v2;
set v2=;
LOAD
1 as Iteration,
'$(v3)' as V3
AutoGenerate 1;
LET v3 = v1 & ','& v2;
LOAD
2 as Iteration,
'$(v3)' as V3
AutoGenerate 1;
Hi Vegar,
As in the original post, I deleted the 2nd line - so there is no assignment of v2.
However, I now understand the mechanism at work here better - ie that the script variable has migrated into the App.
And I can see how to work around it - you delete it from the variables panel in the App...
But it still feels very wrong! This automatic migration from script to app makes me very uncomfortable; Its like the App has a sort of homeopathic memory of all variables that were ever used at some point in its past!
It can lead to some very unexpected behaviour in load scripts if you aren't aware. I have Apps which have been in development for years, undergoing countless revisions and often being duplicated to serve as the basis for new Apps.
I don't think this needs any further discussion, but in any other context I would describe it as a bug - where else would you expect to have to delete a variable not only from the code, but also the executable?
Thanks for your help,
Dave
I see your point, but there are also advantages from having it this way. It might help you understand the concept if you see the script and the gui as an unity and not two separate entities.