Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
demoustier
Creator
Creator

Table rotation in the script

Good day,

I have a table as below:

 

NameTypeCount
XA1
XB2
YA3
YC4
ZA5
ZC6
ZD7

and I need to have a transposed table generated by the script as below:

 

NameABCD
X12
Y3 4
Z5 6

7

In other word, I need to define, in the script, the name of a field by a formula.

Do you think it's possible ?

Any idea ?

Kind regards

1 Solution

Accepted Solutions
Not applicable

Try this,

Test:

Generic

Load * Inline

[

  Name, Type, Count

  X, A, 1

  X, B, 2

  Y, A, 3

  Y, C, 4

  Z, A, 5

  Z, C, 6

  Z, D, 7

];

NoConcatenate

Test_Temp:

Load *

Resident Test.A;

Join(Test_Temp)

Load *

Resident Test.B;

Join(Test_Temp)

Load *

Resident Test.C;

Join(Test_Temp)

Load *

Resident Test.D;

DROP Tables Test.A,Test.B,Test.C,Test.D;

View solution in original post

7 Replies
MK_QSL
MVP
MVP

Generic

Load * Inline

[

  Name, Type, Count

  X, A, 1

  X, B, 2

  Y, A, 3

  Y, C, 4

  Z, A, 5

  Z, C, 6

  Z, D, 7

];

Anonymous
Not applicable

Hi,

why you want to do this in the script?

Isnt better to do in a pivot table in QlikView?

Regards.

Anonymous
Not applicable

If you import a Excel file you cando this:

Directory;
LOAD F2,
     F3,
     F5,
     F7,

FROM
[..\External Data\test.xls]
(biff, embedded labels, table is A$, filters(
Transpose(),
Transpose(),
Transpose()
));

Have a look for the second step of importation:

Regards.

demoustier
Creator
Creator
Author

Hi,

I need to export the result by .qvd, it's why I want it in the script (unless there is a possibilties to export a pivot table into .qvd ???)

Unfortunately, the source is not an Excel but directly from a data base

Not applicable

Try this,

Test:

Generic

Load * Inline

[

  Name, Type, Count

  X, A, 1

  X, B, 2

  Y, A, 3

  Y, C, 4

  Z, A, 5

  Z, C, 6

  Z, D, 7

];

NoConcatenate

Test_Temp:

Load *

Resident Test.A;

Join(Test_Temp)

Load *

Resident Test.B;

Join(Test_Temp)

Load *

Resident Test.C;

Join(Test_Temp)

Load *

Resident Test.D;

DROP Tables Test.A,Test.B,Test.C,Test.D;

demoustier
Creator
Creator
Author

Wooww !!!!

it's works !!!!

What does it means "Resident Test.B" ???

Not applicable

Please refer the link for more drtails about generic load.

The Generic Load

Regards,

Sindhu Kannan.