Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jamelmessaoud
Contributor

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
Valued Contributor

Re: Change Data Format

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

6 Replies
manoj217
Contributor II

Re: Change Data Format

Hi jamel,

Yes, it is possible go through with cross table.

it will convert columns to rows like as you requested.

Regards,

Manoj

jamelmessaoud
Contributor

Re: Change Data Format

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
Valued Contributor

Re: Change Data Format

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
Contributor II

Re: Change Data Format

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
Valued Contributor

Re: Change Data Format

I would say

The Generic Load

jamelmessaoud
Contributor

Re: Change Data Format

Thanks a lot for your help guys.

All sorted !

Community Browser