Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

amitakhera
New Contributor

Converting/Transforming rows data into columns

I am working on a problem in Qliksense and would highly appreciate your help. I have a table with client survey data with multiple rows of data by stage that I need to combine into columns such that each stage becomes a column. And then I want to calculate the difference between Min(Stage Number) and Max(Stage Number) value

base file.jpg

This needs to be converted into :

Transformed file.jpg

The file expected output is a file that has the starting score and the latest score ( irrespective of stage)

Output file.jpg

Any help/leads on this would be highly appreciated

5 Replies

Re: Converting/Transforming rows data into columns

If you really want to do it (the second mentioned intermediated step) within the script you need The Generic Load‌ but you could also just use a table-chart with your mentioned expressions to get such a view.

- Marcus

praveenkumar_ma
Contributor

Re: Converting/Transforming rows data into columns

Hi Amita,

you could also just use a Pivot table-chart(Cross Table) with your mentioned expressions to get such a view.

If you could share sample so we can look at it and analysis Amita.

may be Helpful..

Thanks

PM

ckarras22
New Contributor II

Re: Converting/Transforming rows data into columns

Hello Amita,

For presentation purposes as Marcus mentions, and in case you want to use a straight table the Generic load is the only way.

You don't need any pivoting to take the final result though.

Please find attached a qvf that has all the tables as appear in your post.

BR

Christos K.

amitakhera
New Contributor

Re: Converting/Transforming rows data into columns

Thanks Marcus for your reply,

Can you explain what you mean by table-chart? Is it possible to provide the code so I can try it on my data?

Re: Converting/Transforming rows data into columns

A table-chart just means a pivot-table or a straight-table and by the pivot you could used Stage as vertically dimension and Stage Number as horizontally to get your second table and with a straight-table you could easily create your third table.

I think the following links will be helpful for you:

Qlik Sense - Using the Pivot Table Object (video)

Qlik Sense Table that looks like a pivot table

- Marcus