Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
jamelmessaoud
Creator II
Creator II

Change Data Format

Hi guys,

I have some data imported that looks like this..

  

Type01/01/201802/01/2018
In1060
Out2070
Total Balance30130

Within my load script I want to transform the output to this

   

DateInOutTotal Balance
01/01/2018102030
02/01/20186070130

Is this possible at all?

Thanks

J

1 Solution

Accepted Solutions
bwisealiahmad
Partner - Specialist
Partner - Specialist

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.

Capture.PNG

If above is what you want then that could be one way

Best,

Ali A

View solution in original post

6 Replies
manoj217
Creator III
Creator III

Hi jamel,

Yes, it is possible go through with cross table.

it will convert columns to rows like as you requested.

Regards,

Manoj

jamelmessaoud
Creator II
Creator II
Author

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

bwisealiahmad
Partner - Specialist
Partner - Specialist

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.

Capture.PNG

If above is what you want then that could be one way

Best,

Ali A

manoj217
Creator III
Creator III

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()
));

zebhashmi
Specialist
Specialist

I would say

The Generic Load

jamelmessaoud
Creator II
Creator II
Author

Thanks a lot for your help guys.

All sorted !