Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
What is the syntax to have a table with fields and apply maps and a preceding load with calculations?
I will need to use the Apply Map fields in calculations in the preceding load as well.
Thanks!
Could you detail a bit how your calculcations look like?
In general, it could look like
MAP:
MAPPING
LOAD Key, Value FROM ....;
TABLE:
LOAD A, B, C, B*C as D;
LOAD A,
ApplyMap('MAP', A) as B,
C,
...
FROM ...;
hi,
I hope this exmple may be helps u
Applymap():
++++++++++++++++++++++++
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;
TableA:
Sales:
LOAD ApplyMap('Temp', Product ,'NoDATA') as PurchasePrices,* Inline [
SalesID,Product,SalesPrice,Quantity,SalesDate
S1, Product1, 10, 10, 10/10/2010
];
HI,
Try like this
MappingTable:
MAPPING LOAD
Field1,
Field2
FROM DataSource;
Data:
LOAD
*,
Measure 1 - Measure2 AS Measure3;
LOAD
*,
ApplyMap('MappingTable', Dim1) AS NewField
FROM Table1;
Hope this helps you.
Regards,
Jagan.
That worked! My problem was the preceding load had a sum in it. Thanks!