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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If condition on load script

I have the following if condition on my load script and it appears that part of it may not be working correctly.

if (Match([Res ID],'100529','400068','104198','609022') or [Res Direct ID]='CTL01' and [Disti LOB]=39,'ABC',

     if (Match([Res ID],'100529','400068','104198','609022') or [Res Direct ID]='CTL01' and [Disti LOB]<>39,'ABC thru POS',

     if (Match([Res ID],'100522','603207','608094') or [Res Direct ID]='VRZ01' and [Disti LOB]=39,'DEF',

     if (Match([Res ID],'100522','603207','608094') or [Res Direct ID]='VRZ01' and [Disti LOB]<>39,'DEF thru POS',

     if (Match([Res ID],'102786','104805','608095', '609482') or [Res Direct ID]='ATT01' and [Disti LOB]=39,'HIJ',

     if (Match([Res ID],'102786','104805','608095', '609482') or [Res Direct ID]='ATT01' and [Disti LOB]<>39,'HIJ thru POS','Other')))))) as [Domestic Tier 1]

The items listed with 'thru POS' don't seem to be picking up correctly.  Does the <> seem to be the issue?????

Any suggestions????

2 Replies
Not applicable
Author

Hi

Might be better to use "" when there are blanks but

i suggest you make it lighter using applymap

build a oad inline mapping table with your codes and just test

applymap(''Map_table', [Res ID], & [Res Direct ID] & [Disti LOB])  as  [Domestic Tier 1]

best regards

chris

hic
Former Employee
Former Employee

The <> operator should work.

I would use brackets to be sure that the precedence between AND and OR works the way you want. I.e. not

     Match([Res ID],'100529','400068','104198','609022') or [Res Direct ID]='CTL01' and [Disti LOB]=39

but instead

     ( Match([Res ID],'100529','400068','104198','609022') or [Res Direct ID]='CTL01' ) and [Disti LOB]=39

HIC