Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Valued Contributor

Re: ApplyMap is not working with SQL

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";

Re: ApplyMap is not working with SQL

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

MVP
MVP

Re: ApplyMap is not working with SQL

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

Re: ApplyMap is not working with SQL

Hi,

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

Not applicable

Re: ApplyMap is not working with SQL

Hi,

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

Not applicable

Re: ApplyMap is not working with SQL

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";

MVP
MVP

Re: ApplyMap is not working with SQL

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

kumarnatarajan
Valued Contributor

Re: ApplyMap is not working with SQL

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";

MVP & Luminary
MVP & Luminary

Re: ApplyMap is not working with SQL

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.