Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Im loading data from two sources as per below.
Need the data in one table only. What would be the easiest way?
In my data a value for VOLUME alsways has a corresponding RATE value.
Source 1.
Month1,
QuarterYear,
QYear,
Type,
Volume
Source 2.
Month1,
QuarterYear,
QYear,
Type,
Rate
If you want to join the tables you can use the join keyword
LOAD
Month1,
QuarterYear,
QYear,
Type,
Volume
FROM ....
join
LOAD
Month1,
QuarterYear,
QYear,
Type,
Rate
FROM ...
But you could also concatenate the tables instead of joining them. In that case use CONCATENATE instread of JOIN.
I would suggest a mapping approach.
map_Rate:
MAPPING LOAD
Month1&QuarterYear&Qyear&Type,
Rate
FROM Source2
100:
LOAD
*,
Applymap('map_Rate', Month1&QuarterYear&Qyear&Type) as Rate
FROM Source 1
This will add the rate info for each combination of 'Month1&QuarterYear&Qyear&Type' that is similar in your Source 1.
Regards,
johan
QUALIFY Month1,QuarterYear,QYear,Type;
Source1:
load
* ,Month1&QuarterYear&QYear&Type as Key
Inline
[
Month1,QuarterYear,QYear,Type,Volume
];
Source2:
load *,Month1&QuarterYear&QYear&Type as Key
Inline
[
Month1,QuarterYear,QYear,Type,Rate
]