Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day,
I have a table as below:
Name | Type | Count |
X | A | 1 |
X | B | 2 |
Y | A | 3 |
Y | C | 4 |
Z | A | 5 |
Z | C | 6 |
Z | D | 7 |
and I need to have a transposed table generated by the script as below:
Name | A | B | C | D |
X | 1 | 2 | ||
Y | 3 | 4 | ||
Z | 5 | 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
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;
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
];
Hi,
why you want to do this in the script?
Isnt better to do in a pivot table in QlikView?
Regards.
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.
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
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;
Wooww !!!!
it's works !!!!
What does it means "Resident Test.B" ???