Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
prabhas277
Creator
Creator

Applymap

Hi,

I have Two tables T1 and T2.  T1 contains 5 fields and t2 contains 5 fields now i want do the apply map  for these 2 tables. In this case apply map is possible? IF possible How we can do it?

Thanks in advance

prabhas

8 Replies
Anonymous
Not applicable

Applymap table can support Two fields only in reference table.

Anonymous
Not applicable

Hi, have you thought about concatenate as an option?

Digvijay_Singh

Applymap can help you to pull fields from table T1 to Table T2 or vice versa only in case you have few common fields between them.

So you would create map tables first ( I assume you are aware that map table can have only two fields), the first field will be the lookup field( common between both tables) and the second field is the desired field needed to move between tables based on the matching values of the lookup field.

Example -

Map_productPrice:

Mapping LOAD productId,

     stdPrice

FROM

[..\QVD\Product.QVD]

(qvd);

in fact table, we can pull stdPrice from above map table for the matching productId.

productId,

unitsSold*Applymap('Map_productPrice',productId) as [# Sales Amount],

prabhas277
Creator
Creator
Author

Thanks for sharp response.

can give explain the same with suitable example ..?

Digvijay_Singh

You have one table having Country Code, Country Name, Country Desc

Another table, a fact table, you can call as sales having country Code in each row.

You want to create country name in sales table using mapping table, using the first table. Also you want to show 'Unknown' in case country is not available in map table. You can do it like below -

Map_Country:

Mapping load

     [Country Code],

      [Country Name]

Resident Country table;

Sales:

.....( Other fields)

.....

[Country Code],

Applymap('Map_Country',[Country Code],'Unknown') as [Country Name]   //Here you are pulling country name in                                                                                                                                            //sales table

From

     Sales source file;

Not applicable

using apply map you can get only one field not more than that....prabhas277

qlikview979
Specialist
Specialist

Hi ,

If you want to apply map,take  resident Two to fields from  T1.

Ex:-

T1:

Load

Country Code,

Country Name,

Country Sales...

from.......;


T2:

mapping load

Country Code,

Country Name

resident T1;

T3:

mapping load

Country Code,

Country Sales

resident T1;


--

-

-

-

-

Drop Table T1;


Regards


tyagishaila
Specialist
Specialist

Depends on your requirement. Applymap can fetch single field value at a time.