Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

apply map

Hi Friends

I have written following script in my data load

Screenshot_1.png

But it does give any results for 2nd apply map condition. Have I made any error . Pls help me to get it correct

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Your logic is wrong. I'd like to add some spaces to your statement:but you posted a screenshot and that's difficult to edit...

The second ApplyMap() call is only executed when CRE_TYPE='2', but this test is embedded as third parameter in the first ApplyMap() call that is only executed when CRE_TYPE='1'. The third parameter of an ApplyMap() call is only executed if the second parameter cannot be found in the Mapping Table as specified by the first parameter.

CRE_TYPE cannot have two values at the same time.

I guess you better write someting like:

IF (CRE_TYPE='1', ApplyMap('map1C', ..., Null()),

                  IF (CRE_TYPE='2', ApplyMap('map2C', ..., Null()))) AS CP_RATE

View solution in original post

2 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Your logic is wrong. I'd like to add some spaces to your statement:but you posted a screenshot and that's difficult to edit...

The second ApplyMap() call is only executed when CRE_TYPE='2', but this test is embedded as third parameter in the first ApplyMap() call that is only executed when CRE_TYPE='1'. The third parameter of an ApplyMap() call is only executed if the second parameter cannot be found in the Mapping Table as specified by the first parameter.

CRE_TYPE cannot have two values at the same time.

I guess you better write someting like:

IF (CRE_TYPE='1', ApplyMap('map1C', ..., Null()),

                  IF (CRE_TYPE='2', ApplyMap('map2C', ..., Null()))) AS CP_RATE

upaliwije
Creator II
Creator II
Author

Thanks a lot