Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ApplyMap in a SQL statement

I am pulling data from a SQL database into Qlikview and attempting to Apply a Mapping.

ErrorSource: Microsoft SQL Server Native Client 11.0, ErrorMsg: 'ApplyMap' is not a recognized built-in function name.

I'm guessing this message is because I am attempting to use 'ApplyMap' in the select statement and it is not a SQL function.  Does someone know of another way to accomplish this?

Thank You

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can use a preceding LOAD statement:

LOAD

     FIELD,

     ApplyMap('MAP', FIELD, 'No Map found') as MappedField;

SELECT FIELD FROM ...;

View solution in original post

6 Replies
alexpanjhc
Specialist
Specialist

In the SQL codes(where you connect Qlik to your DB) itself, you can't use applymap. use after you pull the tables.

sunny_talwar

Try doing it in the LOAD statement (preceding load) to use ApplyMap because ApplyMap is a QlikView function.

Qlik Design Blog : Preceding Load | Qlik Community

swuehl
MVP
MVP

You can use a preceding LOAD statement:

LOAD

     FIELD,

     ApplyMap('MAP', FIELD, 'No Map found') as MappedField;

SELECT FIELD FROM ...;

Not applicable
Author

The Preceding load worked but my following SELECT statement did not pull in the rest of the data,

LOAD

     FIELD,

     ApplyMap('MAP', FIELD, 'No Map found') as MappedField;

SELECT FIELD, Field2, field3,

FROM ...;

I only get the MAP and FIELD.

O think I'm on the right track though.  thanks,

maxgro
MVP
MVP

if you want also the other 2 fields, add the 2 fields to the load (in bold)

LOAD

     FIELD,

     Field2, field3,

     ApplyMap('MAP', FIELD, 'No Map found') as MappedField;

SELECT FIELD, Field2, field3,

FROM ...;

Not applicable
Author

Thank you all.  Very helpful!