Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
what is the scope of variables in qlik sense?
Are all variables global in qlik sense
Yes you can use the variable after a loop, but be aware that in your example the variable will be 10 outside of the loop.
SET var=;
For var = 0 to 9
Trace In loop var=$(var);//The variable will be between 0-9
Next var //the var value increase with +1. When >9 the loop stops.
Trace After loop var=$(var); //The variable is now 10
Yes, I would say that you can consider all variables in an Qlik Sense application as global, with exceptions for local variables within a SUB.
However, you might run into vG. (global) and vL. (local) variables if you run into environments using the QDF standard variable naming conventions. In this cases the local/global has no technical limitations, it is only limited by naming and usage conversions set by the framework.
so,if i create a variable called "var" using for..next loop in one table,Can I use that variable in other table?
ex: for var=1 to 9....next
Yes you can use the variable after a loop, but be aware that in your example the variable will be 10 outside of the loop.
SET var=;
For var = 0 to 9
Trace In loop var=$(var);//The variable will be between 0-9
Next var //the var value increase with +1. When >9 the loop stops.
Trace After loop var=$(var); //The variable is now 10