Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

pierrepayen
New Contributor

Table pivot in Loading script

Hello All,

I am new on Qlikview so accept my apologizes if my question is too easy.

in a loading script I am loading a table like the one below:

ProjectEst Cost 2017Est Cost 2018Est Cost 2019Est Cost 2020
Proj 1100508080
Proj 21201007050
Proj 3......
Proj 4

I would like to create in the script a table from the one above to look like the one below:

ProjectEst costYear
Proj11002017
Proj 1502018
Proj 1802019
Proj 1802020
Proj 21202017
Proj 21002018
Proj 2702019
Proj 2502020
...

Would you know how to do that?

Regards,

Pierre.

1 Solution

Accepted Solutions
sergio0592
Valued Contributor II

Re: Table pivot in Loading script

Hi Pierre,

Take a look here. Cross table instruction will help you

The Crosstable Load

5 Replies
sergio0592
Valued Contributor II

Re: Table pivot in Loading script

Hi Pierre,

Take a look here. Cross table instruction will help you

The Crosstable Load

el_aprendiz111
Valued Contributor

Re: Table pivot in Loading script

Hi Pierre

tmp:
CrossTable(Year, [Est Cost])
LOAD * Inline
[
Project,Est Cost 2017,Est Cost 2018,Est Cost 2019,Est Cost 2020
Proj 1,100,50,80,80
Proj 2,120,100,70,50
Proj 3,90,90,,
Proj 4,,,10,1
]
;

NoConcatenate

SUMARY:
LOAD
Project,
[Est Cost],
Right(Year,4) as Year Resident tmp
Where [Est Cost]>0
;

DROP Table tmp;

Projet.png

Highlighted
ankitasinghal
New Contributor II

Re: Table pivot in Loading script

Hi ,

You could also use Pivot chart directly and get this result.

Kindly find attached QV document in which i did same.

Thanks ,

Ankita

pierrepayen
New Contributor

Re: Table pivot in Loading script

Thank you very much, it works great.

Regards,

Pierre.

pierrepayen
New Contributor

Re: Table pivot in Loading script

Thank you very much for your help, this is ,perfect.

Regards,

Pierre.