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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ecabanas
Creator II
Creator II

select only numeric values

Hi,

I have this map in load script:

INVENTTRANS:

LOAD *,

    

    ApplyMap('WAC_MAP',LINK_WAC) AS WAC

     

from $(VStore)INVENTTRANS_WAC.qvd (qvd);

I would like to applymap only if the field is numeric is it possible?

1 Solution

Accepted Solutions
sunny_talwar

You might need another ) after your first ApplyMap like this:

If(IsNum(ApplyMap('WAC_MAP',LINK_WAC)), ApplyMap('WAC_MAP',LINK_WAC) ,TARIFAREFERENCIAL) as WAC



HTH


Best,

S

View solution in original post

6 Replies
rubenmarin

Hi Eduard, you can use the IsNum() function, ie:

If(IsNum(LINK_WAC, ApplyMap('WAC_MAP',LINK_WAC) [,InstructionsIfNotIsNumeric]) as WAC

Not applicable

Hi Eduard,

the other option you have is to ensure only numerical values are present in your applymap itself, then that is only what will be mapped when you use it

hope that helps

Joe

sunny_talwar

If your mapping load table doesn't have a mapping available for certain LINK_WAC the default value will be LINK_WAC unless you specify another default value. Take a look at the image below:

HTH

Best,

S

ecabanas
Creator II
Creator II
Author

Hi Ruben,

I did but it returns this error:

Error in expression:

IsNum takes 1 parameter

INVENTTRANS:

LOAD *,

    

    If(IsNum(ApplyMap('WAC_MAP',LINK_WAC), ApplyMap('WAC_MAP',LINK_WAC) ,TARIFAREFERENCIAL) as WAC

    

from E:\Data BI\Documents\QVD\INVENTTRANS_WAC.qvd (qvd)

Many thank's

sunny_talwar

You might need another ) after your first ApplyMap like this:

If(IsNum(ApplyMap('WAC_MAP',LINK_WAC)), ApplyMap('WAC_MAP',LINK_WAC) ,TARIFAREFERENCIAL) as WAC



HTH


Best,

S

ecabanas
Creator II
Creator II
Author

Many many thank's Ruben