Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm not really sure how to phrase this but my issue deals with having multiple columns in a table that have a month attached to it.
For example, the table looks like this:
Location,
Item,
Current_period_purchased,
Current_period_sold,
Current_period_transferred,
Period1_Purchased,
Period1_sold,
Period1_transferred,
Period2_Purchased,
Period2_sold,
Period2_transferred,
etc.
What I'm trying to do is have the periods grouped together with month, purchased, sold, and transferred being columns:
Location,
Item,
Month,
Purchased,
Sold,
Transferred
Is there any way to do this? I was thinking crosstable but I'm not sure how to execute that.
Thank you in advance.
You have to check and try with below load script as you describe there is different fields but they have common values and field name then try like
Load
Location,
Item,
Current_period_purchased as Purchased,
Current_period_sold as Sold,
Current_period_transferred as Transferred
From Location;
Concatenate
Load
Location,
Item,
Period1_Purchased as Purchased,
Period1_sold as Sold,
Period1_transferred as Transferred
From Location;
Concatenate
Load
Location,
Item,
Period2_Purchased as Purchased,
Period2_sold as Sold,
Period2_transferred as Transferred
From Location;
I think this is closer to what I need and it gives me an idea.
Perhaps loading the script like this will work:
Load
month(now() as Month,
Location,
Item,
Current_period_purchased as Purchased,
Current_period_sold as Sold,
Current_period_transferred as Transferred
From Table;
Concatenate
Load
'January' as Month,
Location,
Item,
Period1_Purchased as Purchased,
Period1_sold as Sold,
Period1_transferred as Transferred
resident Table;
Concatenate
Load
'February' as Month,
Location,
Item,
Period2_Purchased as Purchased,
Period2_sold as Sold,
Period2_transferred as Transferred
resident Table;
and so on