Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested if Condition in Script

Hi all,

I am new to qlikview. I used nested if conditions in my script. But some of the conditions doesnt work. (Test1 and Test2, mentioned in the script)

Sample:

LOAD Product,

if((Product='Two Wheelers' or Product='Three Wheelers') and Level='Level1','Test3',

  if(Product='Two Wheelers','Test1',

  if(Product='Three Wheelers','Test2'))) as New_Skill,

  Level,

  Value

FROM

(ooxml, embedded labels, table is Sheet2);

I know the first condition satisfies , so it not performing the other conditions. But i need Test1 and Test2 in the New_Skill Field.

Please find the attachment and help me sort out this issue.

Regards,

Siva

13 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

I see nothing in your original question which implies a cross table load is required.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sasiparupudi1
Master III
Master III

Please provide your full data document so that it would be easier to provide a solution otherwise it will be a guess work

Not applicable
Author

Hi Jonathan,

How you will get the attached word file output with my Original script. It is not possible.

Regards,

Siva

stigchel
Partner - Master
Partner - Master

Hi Siva,

The third parameter of the crosstable load defines how many fields from the top are loaded as qualifier fields. So in this case instead of the rowno, you can use your key (and name it to the other linking field)

CrossTable (New_Skill,Product,1) load

ProductID&'-'&CategoryID As Id,

if((Product='Two Wheelers' or Product='Three Wheelers') and Level='Level1',Product) as Test3,

  if(Product='Two Wheelers',Product) as Test1,

  if(Product='Three Wheelers',Product) as Test2

resident Sample;