Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fetching multiple fields using applymap

Hi all i have a requirement where i want to bring 3 fields using applymap

Table1

Id

1

2

3

Table2

Id   country region  age

1     i               a           26

2      b           c             11

How can i achieve it

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can either JOIN the tables

or

MAP:

MAPPING

LOAD Id, country &'|'& region &'|'& age as value

FROM Table2;

LOAD Id,

       Subfield( Applymap('MAP', Id), '|',1) as country,

       Subfield( Applymap('MAP', Id), '|',2) as region,

       Subfield( Applymap('MAP', Id), '|',3) as age,

     ...


View solution in original post

3 Replies
maxgro
MVP
MVP

If I understand,

you can use a separator in the second field of fhe mapping table

MapTable:

Mapping load * inline [

f1, f2

1, i|a|26

2, b|c|11

];

X:

load

  f,

subfield(ApplyMap('MapTable', f,), '|', 1) as m1,

  subfield(ApplyMap('MapTable', f,), '|', 2) as m2,

  subfield(ApplyMap('MapTable', f,), '|', 3) as m3

inline [

f

1

2

];

swuehl
MVP
MVP

You can either JOIN the tables

or

MAP:

MAPPING

LOAD Id, country &'|'& region &'|'& age as value

FROM Table2;

LOAD Id,

       Subfield( Applymap('MAP', Id), '|',1) as country,

       Subfield( Applymap('MAP', Id), '|',2) as region,

       Subfield( Applymap('MAP', Id), '|',3) as age,

     ...


Not applicable
Author

Thank you stefan it solved the problem

I have another roblem which is cracking my mind can you please help me please

Count in staright table for last six months