Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
How do we transpose the table on the script level?
Load dimension 1,dimension 2,dimension 3,Value,Week from Table1
Below is the table
dimension 1 | dimension 2 | dimension 3 | Value | Week |
123 | abc | 12ab | PG | W1 |
234 | def | 13ab | XX | W2 |
345 | tre | 14ab | PG | W1 |
456 | euw | 15ab | PG | W2 |
567 | hdj | 16ab | PG | W1 |
678 | dsj | 17ab | PG | W2 |
789 | dhma | 18ab | XX | W1 |
900 | ksd | 10ab | PG | W2 |
1011 | hcd | 10ab | PG | W1 |
1011 | hcd | 10ab | PG | W2 |
This is the required output
dimension 1 | dimension 2 | dimension 3 | W1 | W2 |
123 | abc | 12ab | PG | |
234 | def | 13ab | XX | |
345 | tre | 14ab | PG | |
456 | euw | 15ab | PG | |
567 | hdj | 16ab | PG | |
678 | dsj | 17ab | PG | |
789 | dhma | 18ab | XX | |
900 | ksd | 10ab | PG | |
1011 | hcd | 10ab | PG | PG |
Have a look at previous answers to the question of pivoting in script:
https://community.qlik.com/t5/App-Development/how-to-pivot-in-load-script/td-p/1513761
https://community.qlik.com/t5/QlikView-App-Dev/Pivot-Data-in-Qlik-Load-Script/td-p/34819
Something like these
if ("Week"='W1',Value) AS W1,
if ("Week"='W2',Value) AS W2