Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
dreweezy
Creator II
Creator II

transposing / pivoting in the data load editor

I just learned the capability of using the cross-table function which is very effective when needed. I am looking for something that will do that opposite and instead take the values from a field and transpose/pivot those are my new column header. 

Capture.PNG

I'd like to take that table above and transform is so that the SPORTS column will transpose and will become my headers as below. 

Capture.PNG

Does anyone have guidance on how to achieve this output in qlik sense?

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

In the front end you can use a pivot table and move the sport as a column.
you can achieve in script too using generic load (your need is kind of opposite of cross table load) see below
https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470

View solution in original post

4 Replies
dplr-rn
Partner - Master III
Partner - Master III

In the front end you can use a pivot table and move the sport as a column.
you can achieve in script too using generic load (your need is kind of opposite of cross table load) see below
https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470
dreweezy
Creator II
Creator II
Author

Awesome this is what I was looking for (the generic load concept) thanks!

dreweezy
Creator II
Creator II
Author

Again, thanks for the link as I have a better understanding on what a generic load is. One thing that is a bit confusing for me is on the qlik website it states that a generic load:

** The generic prefix unpacks a tall table, creating one field per attribute value. This is similar to pivoting a table, except that it results in a separate table per field created.

I actually do not want the create separate tables. Is there a way to bypass this and instead use the attributes to simply transpose into new header fields?

Thanks.

dplr-rn
Partner - Master III
Partner - Master III

no. you will have to packit all back into 1 table. see the end part of the blog about a for loop and below comments from hic

The result is one big table that contains all attributes; a table that often is sparse (containing many NULL values) and much larger than the initial tables. And no performance has been gained… So I can only say:

You should not do this - unless you have a specific reason to.

The Generic prefix creates a set of tables that store the data in an optimal way. In most cases you should not change this. 
I realize, however, that there are cases where you want to transform the data further and need the data in one, unified table. Then the above scriptlet can be used.