Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can any body give me two real time examples for applymap() where it best suits and
with all benfits by using applymap()
There are so many examples of the Applymap and mapping is used with two fields and it is apply to the table. To facilitate the table with additional field details with the description.
See the below small example
1. See the below simple example from help
Purchase:
LOAD * Inline [
PurchaseID,Product,PurchasePrice,Quantity,PurchaseDate
P9, Product1, 8, 20, 15/10/2010
P11, Product1, 7, 10, 09/10/2010
P12, Product1, 9, 20, 01/10/2010
];
Temp:
Mapping LOAD
Product,PurchasePrice
Resident Purchase;
DROP Table Purchase;
Sales:
LOAD ApplyMap('Temp', Product ) as PurchasePrice,* Inline [
SalesID,Product,SalesPrice,Quantity,SalesDate
S1, Product1, 10, 10, 10/10/2010
];
2. Also small example
CustomerTable:
Mapping Load * Inline
[
CustomerID, Country
A, Germany
B, France
C, Italy
];
Sales:
Load *,
ApplyMap('CustomerTable', CustomerID, 'Unknown') as CustomerCountry
Inline
[
CustomerID, Month, Sales
A, Jan, 100
B, Jan, 200
C, Jan, 300
D, Feb, 150
E, Mar, 200
];
What do you mean with 'real time' examples?
If you search the forum, you'll find plenty examples, also discussions about pros & cons.
There are so many examples of the Applymap and mapping is used with two fields and it is apply to the table. To facilitate the table with additional field details with the description.
See the below small example
1. See the below simple example from help
Purchase:
LOAD * Inline [
PurchaseID,Product,PurchasePrice,Quantity,PurchaseDate
P9, Product1, 8, 20, 15/10/2010
P11, Product1, 7, 10, 09/10/2010
P12, Product1, 9, 20, 01/10/2010
];
Temp:
Mapping LOAD
Product,PurchasePrice
Resident Purchase;
DROP Table Purchase;
Sales:
LOAD ApplyMap('Temp', Product ) as PurchasePrice,* Inline [
SalesID,Product,SalesPrice,Quantity,SalesDate
S1, Product1, 10, 10, 10/10/2010
];
2. Also small example
CustomerTable:
Mapping Load * Inline
[
CustomerID, Country
A, Germany
B, France
C, Italy
];
Sales:
Load *,
ApplyMap('CustomerTable', CustomerID, 'Unknown') as CustomerCountry
Inline
[
CustomerID, Month, Sales
A, Jan, 100
B, Jan, 200
C, Jan, 300
D, Feb, 150
E, Mar, 200
];
outside this forum you can read this (add www)
quickintelligence.co.uk/applymap-is-it-so-wrong
Hi,
Please check these 2 samples one with "Map ... Using" and another with "ApplyMap"
Thanks!