Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys i have a quick question, is it possible to load a specific file dependent on variable? E.G.
*******************
If var1=1
load
*
from file1
*******************
if var1=2
load
*
from file2
***********************
Thanks
Hi,
Yes, use the following in your script:
IF $(var1) = 1 THEN
Table:
LOAD *
FROM File1;
ELSEIF $(var1) = 2 THEN
Table:
LOAD *FROM File2;
END IF
Hope that helps.
BI Consultant
Hi,
Yes, use the following in your script:
IF $(var1) = 1 THEN
Table:
LOAD *
FROM File1;
ELSEIF $(var1) = 2 THEN
Table:
LOAD *FROM File2;
END IF
Hope that helps.
BI Consultant
Hi, thanks very much Miguel, this is working if i use numbers for the variables, but if i use text it does not seem to work, what i am doing wrong?
if $(var1)=1 works, but if $var1)='qwerty' or even without the single quotes i cant seem to get it to work.
Many Thanks
Hi,
Note that as it happens with fields, variables in QlikView are case sensitive for both names and values. Try instead
IF var1 = 'abc' THEN
Without expanding the variable with $().
Hope that helps.
BI Consultant