Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two tables.
The first table has two fields:
MaterialKey,
ConvFactor
The second table has
MaterialKey,
Quantity
I need to get the second table to have a field that is "Quantity(from second table) * ConFactor(from first table) as ConvQuantity".
Can't seem to get this to work with mapping table.
Help!
Thanks,
Stephen
Hi
Something like this (adjust to your data sources):
FactorMap:
Mapping LOAD MaterialKey,
ConvFactor
From .....;
Data:
LOAD
MaterialKey,
Quantity,
ApplyMap('FactorMap' , MaterialKey, 0) AS ConvFactor
From ... ;
The 3rd parameter of ApplyMap is the value to use if the MaterialKey cannot be found in the mapping table
Hope this helps
Jonathan
As mentioned by Jonathan
you can do
ApplyMap('FactorMap' , MaterialKey, 0) * Quantity AS Converted_Quantity
while everything else being the same
Thanks