Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I've looked all over and can't find an answer.
In my load script I have a number of IF statements,
Table1:
Load Field1,
Field2,
if (Field1>=30,1.5,if(Field1>=21,1,0)) as FlagField1
if (Field2>20 and Field2<90,0.5,0) as FlagField2
From abc.xlsx
These created fields work fine in my document but what I'm trying to do next is add all these Flag values (1-9) together to give an FlagOverall field within the load script.
Any ideas
John
Hi
The values Field1 and
Use preceding load like this:
Table1:
LOAD *,
FlagField1 + FlagField2 As FlagOverall
;
Load Field1,
Field2,
if (Field1>=30,1.5,if(Field1>=21,1,0)) as FlagField1
if (Field2>20 and Field2<90,0.5,0) as FlagField2
From abc.xlsx
Hope that helps
Jonathan
Hi
The values Field1 and
Use preceding load like this:
Table1:
LOAD *,
FlagField1 + FlagField2 As FlagOverall
;
Load Field1,
Field2,
if (Field1>=30,1.5,if(Field1>=21,1,0)) as FlagField1
if (Field2>20 and Field2<90,0.5,0) as FlagField2
From abc.xlsx
Hope that helps
Jonathan
Thanks Jonathan. It works perfectly, quite counter intuitive to put it at the top of the script!
John
I would say that it is quite logical to put it on top, once you understand what it does...
See http://community.qlik.com/blogs/qlikviewdesignblog/2013/03/04/preceding-load
HIC
Thanks for the link, it makes sense now.
Life saver!