Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Mapping Load()
Requirements- we have 2 tables:Order & Product, we want table value will map the 2 tables and create one.
My question:
1. Will this script shows the expected output ??
2. Can we use Load * in Mapping load ??
//In load editor
Product:
Mapping
Load *
from [lib://source/product.xlsx];
order:
Load *
ApplyMap('Product','PID'Null()) as Product
from [lib://source/product.xlsx] ;
//Expected output
Order |
Order ID |
Order Name |
Product name |
PID |
Price |
Quantity |
Thanks a lot @Oleg_Troyansky
Hi,
Using * is not advised for Mapping loads. For a successful Mapping load, you need to load only two fields, and they should appear in the correct order - first the field with the values "from" and then the field with the mapped values ("to").
So, if you want to map PID to Product Name, you would do it like this:
Product_Map:
Mapping
Load
PID,
Name
from [lib://source/product.xlsx];
order:
Load
*,
ApplyMap('Product', PID ) as ProductName
from [lib://source/product.xlsx] ;
I recommend to leave the optional third parameter of the ApplyMap() function empty, to see those products that might be missing in the mapping table. Otherwise, you will not be able to see them or select them, if the value is NULL.
Cheers,
Thanks a lot @Oleg_Troyansky