Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

apply map

Hi

I have following two Qvd files

Table 1

Policy_no    Premium

1                    100

2                     100

5                    50

4                    200

2                    50

1                    80

Table 2

Policy_no      Year

1                   2000

2                   2010

5                   2014

4                   1980

I want to create a new table using apply map function where output table should be as follows

Policy_no    Premium     Year

1                    100         2000

2                     100        2010

5                    50           2014

4                    200         1980

2                    50           2010

1                    80           2000

Pls help me write the script

4 Replies
Anonymous
Not applicable

Table2:

mapping load

  Policy_no,

  Year

..

Table1:

load

Policy_no,

Premium,

applymap('Table2', Policy_no) as Year)

..

rubenmarin

Hi upali, one of both tables can be loaded as map and apply in the load of the other:

Map_Table2:

Mapping LOAD Policy_no, Year FRom....

Table:

LOAd Policy_no,

     Premium

     ApplyMap('Map_Table2', Policy_no, 'not found') as Year

FROM...

upaliwije
Creator II
Creator II
Author

Thanks

Can U please upload sample document with my data

rubenmarin

Hi uplai, if you're loading from qvds, the script should be:

Map_Table2:

Mapping LOAD Policy_no, Year From [Path\NameqvdTable2.qvd](qvd);

Table:

LOAd Policy_no,

     Premium

     ApplyMap('Map_Table2', Policy_no, 'not found') as Year

FROM [Path\NameqvdTable1.qvd](qvd);