Discussion Board for collaboration related to QlikView App Development.
Would you please be able to help?
I have a project where I want create a switch between loading data from SQL Select or loading from QVD
So what I am trying to do is, create a variable if vLocation = 0 then load data from SQL, if vLocation = 1 then load data from QVD.
Is this possible, please help.
syntax should be like
if '$(vLocation)' = '1' then
Try like this:
LET vQVDcheck = isnull(QvdCreateTime('QVD Location'));
if $(vQVDcheck ) = -1 THEN
Load from SQL
Load from SQL;
Load from QVD;
Store ab in to ab.qvd;
You can also use Switch Case statement.
case 1 :
case 2 :
I have tried the Switch Case statement, but the queries will be a lot as I have a big dashboard, I mean with lots of scripts, and adding Switch Case to each and every query wouldn't look really appealing.
Am I correct that I will need to add the Switch Case statement in each query?
You can try this by using variables. If you have 10 load statements, you need 10 variables.
The variable is initialised based on the vLocation. Some thing like below
if vlocation=1 then assign the below to vLoad1
if vlocation=0 then assign the below to vload1
then you can use the vLoad1 in the script.
hope this helps.