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: 
Not applicable

applymap...help plssss

Hi Experts,

i have the following script.

MapTable:

Mapping LOAD * INLINE [

    OLD,  NEW

    0831,  0201

    0208,  0214

    0210,  0212

];

Branch:

LOAD

    Applymap('MapTable', BRCODE, BRCODE) as BRCODE,

    BRNAME,

  

FROM

QVD\BRANCH.qvd

(qvd);

Calls:

LOAD  Applymap('MapTable', BRCODE, BRCODE) as BRCODE ,

    Date,

    BRNAME,

    Answered

  

FROM

QVD\DATA.qvd

(qvd);

concatenate

LOAD Date,

    BRNAME,

    Lookup('BRCODE','BRNAME', BRNAME,'Calls')  as BRCODE,

     Answered

 

FROM

QVD\CallDetails.qvd

(qvd)

Sales:

LOAD  Date,

      Amount,

    Applymap('MapTable', BRCODE, BRCODE) as BRCODE

FROM

QVD\Sales.qvd

(qvd);

I want to do mapping on BRCODE for all the above tables.

the applymap does works on all tables except Calls table.

the Calls table (after concatenate) doesn't have BRCODE, so i have done a lookup with the other table.

Now, i have to use applymap for Calls table (after concatenate).

How can i do this...pls help....

13 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

concatenate

LOAD Date,

    BRNAME,

    applymap('MapTable',Lookup('BRCODE','BRNAME', BRNAME,'Calls'))  as BRCODE,

     Answered

FROM

QVD\CallDetails.qvd

(qvd)


talk is cheap, supply exceeds demand
hic
Former Employee
Former Employee

You can either pipe your Lookup() into an Applymap(), like:

Concatenate

LOAD 

    Applymap('MapTable', BRCODE, BRCODE) as BRCODE,

    Date,

    BRNAME,

    Answered;

LOAD

    Date,

    BRNAME,

    Lookup('BRCODE','BRNAME', BRNAME,'Calls')  as BRCODE,

    Answered

FROM QVD\CallDetails.qvd (qvd)

Or you can skip all your Applymap() calls and instead use

   Map BRCODE Using MapTable;

right after you load the mapping table.

HIC

Not applicable
Author

Gysbert,

Thanks for the response.

but still its not working with calls table

Not applicable
Author

thanks henric,

i tried like this,

MapTable:

Mapping LOAD * INLINE [

    OLD,   NEW

    0831,  0201

    0208,  0214

    0210,  0212

];

MAP BRCODE Using MapTable;

Branch:

LOAD

 

     BRCODE ,

     BRNAME

   

FROM

QVD\BRANCH.qvd

(qvd);

Calls:

LOAD BRCODE,

        Date,

     BRNAME

     Answered

    

FROM

QVD\DATA.qvd

(qvd);

concatenate

LOAD Date,

     BRNAME,

      Lookup('BRCODE','BRNAME', BRNAME,'Calls')  as BRCODE,

     Answered

    

FROM

QVD\CallDetails.qvd

(qvd);

Sales:

LOAD    Date,

          Amount,

          ORDTYPE,

         BRCODE

FROM

QVD\Sales.qvd

(qvd);

but still mapping is not done.

Can you pls help me with the script

hic
Former Employee
Former Employee

Without the qvw, it is impossible to say what goes wrong. But I have a suspicion that it is something with the number formats of the values that makes them not getting recognized...

Try testing a mapping table like:

  MapTable:

  Mapping LOAD 'X' & OLD as OLD, NEW INLINE [

  OLD, NEW

  ...

and the corresponding change when you create the BRCODE:

  'X' & BRCODE as BRCODE,

Then you can better see the values of BRCODE and why they don't match.

HIC

Not applicable
Author

Henric,

Should i try like this..?

MapTable:

Mapping LOAD 'X' & OLD as OLD, NEW INLINE [

    OLD,   NEW

    0831,  0201

    0208,  0214

    0210,  0212

];

MAP 'X' & 'BRCODE' as BRCODE Using MapTable;

pls help

Not applicable
Author

help me out plsss

hic
Former Employee
Former Employee

The Mapping Load looks OK.

The Map statement should not be changed. It should be like this:

     MAP BRCODE Using MapTable;

The Load statements where you load BRCODE should be changed:

     Load

          ...

          'X' & BRCODE as BRCODE,

          ...

HIC

Not applicable
Author

Henric,

i have done like this

MapTable:

Mapping LOAD 'X' & OLD as OLD, NEW INLINE [

    OLD,  NEW

    0831,  0201

    0208,  0214

    0210,  0212

];

MAP BRCODE Using MapTable;

Branch:

LOAD  'X' & BRCODE as BRCODE ,

    BRNAME

FROM

QVD\BRANCH.qvd

(qvd);

Calls:

LOAD 'X' & BRCODE as BRCODE,

      Date,

    BRNAME,

    Answered,

    Unanswered,

    Outgoing

FROM

QVD\DATA.qvd

(qvd);

concatenate

LOAD Date,

    BRNAME,

      Lookup('BRCODE' ,'BRNAME', BRNAME,'Calls')  as BRCODE,

      Total,

    Answered,

    Unanswered,

    [Unans Miss %],

    Outgoing

FROM

QVD\CallDetails.qvd

(qvd)

Now all the BRCODE has changed to code with prefix X like X0021 which is not correct.

Normal applymap is working for all tables except the part highlighted in bold red.

pls help me with some solution for that part