Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Applymap table can support Two fields only in reference table.
Hi, have you thought about concatenate as an option?
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],
Thanks for sharp response.
can give explain the same with suitable example ..?
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;
using apply map you can get only one field not more than that....prabhas277
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
Depends on your requirement. Applymap can fetch single field value at a time.