Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Apply Map and Preceding Load

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!

4 Replies
swuehl
MVP
MVP

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 ...;

Not applicable
Author

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
]
;



jagan
Luminary Alumni
Luminary Alumni

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.

Not applicable
Author

That worked! My problem was the preceding load had a sum in it. Thanks!