Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
NickHoff
Specialist
Specialist

Applymap with Dual

I have a mapping load, which looks like the following.

MapDRG795Exclusion:

MAPPING LOAD * INLINE [

    IPOPServiceLine, Exclusion

    I795, 0

];

My apply map looks like the following:

APPLYMAP('MapDRG795Exclusion',IPOPServiceCode,1) AS CasesExcNB795IND,

This will display a 0 for false to exclude for 1 for true to exclude.  I'd like to use the dual function to display a Yes for True and a No for False, while still holding the value of 0 and 1.  How does the syntax work with applymap and dual?

1 Solution

Accepted Solutions
MarcoWedel

Hi,

one suggestion:

QlikCommunity_Message_149341_Pic1.JPG

MapDRG795Exclusion:

MAPPING

LOAD IPOPServiceLine,

    Dual('No',Exclusion)

INLINE [

    IPOPServiceLine, Exclusion

    I795, 0

];

table1:

LOAD RecNo() as ID,

    IPOPServiceCode,

    APPLYMAP('MapDRG795Exclusion',IPOPServiceCode,Dual('Yes',1)) AS CasesExcNB7

INLINE [

    IPOPServiceCode

    I791

    I792

    I793

    I794

    I795

    I796

    I797

    I798

    I799

];

hope this helps

regards

Marco

View solution in original post

7 Replies
Colin-Albert

Try this...

MapDRG795Exclusion:

MAPPING LOAD * INLINE [

    IPOPServiceLine, Exclusion

    I795, dual('No', 0)

];

APPLYMAP('MapDRG795Exclusion',IPOPServiceCode, dual('Yes'),1)) AS CasesExcNB795IND,

NickHoff
Specialist
Specialist
Author

The APPLYMAP part is correct, but the mapping load displays the text dual('No') instead of applying the dual.  Is it possible to do a dual on the mapping load?

MarcoWedel

Hi,

one suggestion:

QlikCommunity_Message_149341_Pic1.JPG

MapDRG795Exclusion:

MAPPING

LOAD IPOPServiceLine,

    Dual('No',Exclusion)

INLINE [

    IPOPServiceLine, Exclusion

    I795, 0

];

table1:

LOAD RecNo() as ID,

    IPOPServiceCode,

    APPLYMAP('MapDRG795Exclusion',IPOPServiceCode,Dual('Yes',1)) AS CasesExcNB7

INLINE [

    IPOPServiceCode

    I791

    I792

    I793

    I794

    I795

    I796

    I797

    I798

    I799

];

hope this helps

regards

Marco

Colin-Albert

The mapping table I posted was incorrect. This will work.

MapDRG795Exclusion:

MAPPING LOAD

     IPOPServiceLine,

     dual('No',0) as Exclusion

INLINE [

    IPOPServiceLine

    I795

     ];

APPLYMAP('MapDRG795Exclusion',IPOPServiceCode, dual('Yes'),1)) AS CasesExcNB795IND,

MarcoWedel

just for fun another one without mapping:

tabDRG795Exclusion:

LOAD * INLINE [

    IPOPServiceLineExcl

    I795

    I797

];

table1:

LOAD RecNo() as ID,

    IPOPServiceCode,

    If(Exists(IPOPServiceLineExcl,IPOPServiceCode),Dual('No',0),Dual('Yes',1)) as CasesExcNB7

INLINE [

    IPOPServiceCode

    I791

    I792

    I793

    I794

    I795

    I796

    I797

    I798

    I799

];

hope this helps

regards

Marco

NickHoff
Specialist
Specialist
Author

There is a huge performance hit when using IF in the load.  That is the reason I went with a mapping load.

MarcoWedel

Thanks

regards

Marco