Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ApplyMap is not working with SQL

Following is the code i have written but its giving an error "Field not found - <STATUS>"

Can anybody please help me to solve this???

Status_Map :

MAPPING LOAD

STATUS,

NAME;

SQL SELECT "STATUS",

    "NAME"

FROM "STATUS_TABLE";

abc:

mapping load

"STATUS",

ApplyMap('Status_Map',"STATUS") as status;

SQL SELECT "ID",

    "STATUS",

FROM "XYZ";

10 Replies
kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

Remove the mapping word in abc table

Ex:

Status_Map :

MAPPING LOAD

STATUS,

NAME;

SQL SELECT "STATUS",

    "NAME"

FROM "STATUS_TABLE";

abc:

load

STATUS,

ApplyMap('Status_Map',STATUS) as status;

SQL SELECT "ID",

    "STATUS",

FROM "XYZ";

Peter_Cammaert
Partner - Champion III
Partner - Champion III

And the double quotes around the two STATUS names in the preceding load for abc can go as well. A preceding load follows QlikView syntax, not SQL syntax.

Peter

MK_QSL
MVP
MVP

Status_Map :

MAPPING LOAD

     STATUS,

     NAME;

SQL SELECT

     "STATUS",

    "NAME"

FROM "STATUS_TABLE";

abc:

Load

"STATUS",

ApplyMap('Status_Map',STATUS) as NAME;

SQL SELECT "ID",

    "STATUS",

FROM "XYZ";

Not applicable
Author

Hi,

Thanks for the reply, I tried reloading after removing mapping word, still its not working.

Not applicable
Author

Hi,

Thanks for the reply, I made all the changes you have mentioned, still its not working.

Not applicable
Author

Status_Map :

MAPPING LOAD

     STATUS,

     NAME;

SQL SELECT

     "STATUS",

    "NAME"

FROM "STATUS_TABLE";

abc:

Load

"STATUS",

ApplyMap('Status_Map',STATUS) as STATUS1;

SQL SELECT "ID",

    "STATUS",

FROM "XYZ";

tresesco
MVP
MVP

Have you tried the code that Kumar Natarajan suggested? What is the error message you are getting there?

kumarnatarajan
Partner - Specialist
Partner - Specialist

HI kanvi,

First check your mapping table status and applymap table status field value format.

The below syntax are right.

Status_Map :

MAPPING LOAD

STATUS,

NAME;

SQL SELECT "STATUS",

    "NAME"

FROM "STATUS_TABLE";

abc:

load

STATUS,

ApplyMap('Status_Map',STATUS) as Name;

SQL SELECT "ID",

    "STATUS",

FROM "XYZ";

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this

Status_Map :

MAPPING LOAD

STATUS,

NAME

WHERE 1=1;

SQL SELECT "STATUS",

    "NAME"

FROM "STATUS_TABLE";

abc:

load

ID,

STATUS,

ApplyMap('Status_Map',STATUS) as Name;

SQL SELECT "ID",

    "STATUS",

FROM "XYZ";

Regards,

Jaan.