Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am facing an issue in mapping load script.
MappingTableAddr:
Mapping load
CustomerID,
Address
from abc.qvd;
MappingTableCity:
Mapping load
CustomerID,
City
from abc.qvd;
Table11:
BillDate,
CustomerID,
Applymap('MappingTableAddr',CustomerID,'NA') as Address,
Applymap('MappingTable'City,CustomerID,'NA') as City
from abc.qvd;
My raw data is
I have null values for the bill date 1.4.21. I would like to copy the same address since the customer ID is same. I tried the above code but I still get NULL values. Any help.
Thanks in advance!
Since your CustomerID is numeric, try to convert it as text by using Text()in both mapping tables and fact table.
MappingTableAddr:
Mapping load
Text(CustomerID) as CustomerID
Address
from abc.qvd;
MappingTableCity:
Mapping load
Text(CustomerID) as CustomerID
City
from abc.qvd;
Table11:
Load
BillDate,
CustomerID,
Applymap('MappingTableAddr',text(CustomerID),'NA') as Address,
Applymap('MappingTable'City,Text(CustomerID),'NA') as City
from abc.qvd;