Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I have some data imported that looks like this..
Type | 01/01/2018 | 02/01/2018 |
In | 10 | 60 |
Out | 20 | 70 |
Total Balance | 30 | 130 |
Within my load script I want to transform the output to this
Date | In | Out | Total Balance |
01/01/2018 | 10 | 20 | 30 |
02/01/2018 | 60 | 70 | 130 |
Is this possible at all?
Thanks
J
Hi,
I would CrossTable that table and then make a Pivot Table.
Temp_Table:
CrossTable(Date, Values)
LOAD Type,
[43101],
[43102]
FROM
(ooxml, embedded labels, table is Sheet1);
Facts:
NoConcatenate
LOAD
Type,
Date(Num#(Date)) AS Date,
Values
Resident Temp_Table;
Drop Table Temp_Table;
Then you can do a Sum(Values) and create a Pivot Table. On the rows you add date and on columns you add Type.
If above is what you want then that could be one way
Best,
Ali A
Hi jamel,
Yes, it is possible go through with cross table.
it will convert columns to rows like as you requested.
Regards,
Manoj
Hi Manoj,
I tried a crosstable but couldn't figure it out. Would you happen to know what to put within the load script?
Thanks very much
J
Hi,
I would CrossTable that table and then make a Pivot Table.
Temp_Table:
CrossTable(Date, Values)
LOAD Type,
[43101],
[43102]
FROM
(ooxml, embedded labels, table is Sheet1);
Facts:
NoConcatenate
LOAD
Type,
Date(Num#(Date)) AS Date,
Values
Resident Temp_Table;
Drop Table Temp_Table;
Then you can do a Sum(Values) and create a Pivot Table. On the rows you add date and on columns you add Type.
If above is what you want then that could be one way
Best,
Ali A
Hi Jamel,
While loading the excel go to the transformation step and select transpose.
it will creates the below code, no need to write the code manually. please find the below code for your reference.
LOAD Type,
In,
Out,
[Total Balance]
FROM
(ooxml, embedded labels, table is Sheet1, filters(
Rotate(right),
Rotate(right),
Rotate(right),
Rotate(right),
Transpose(),
Transpose(),
Transpose()
));
I would say
Thanks a lot for your help guys.
All sorted !