Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
rushi1093
Contributor II
Contributor II

transpose the table

I want transpose the table's column into separate entries? 

for ex.

Perm ID Code Count Code Count
abc kyubis1 24 kyubis2 33
def kyubij1 19 krsfgd2 46

 

Can i convert this to : 

Perm ID Code Count
abc kyubis1 24
abc kyubis2

33

def kyubij1

19

def krsfgd2

46

 

just to have separate and distinct data instead of horizontal repeatation. 

Please help

Labels (1)
5 Replies
rubenmarin

Hi, the first table has some columns with the same name, I don't know how you can refer to the second 'Code' column. I think your real data might be different and it will be better to have an example of that real structure example.

If it helps: to split a row with separators in different rows you can use subfield() fucntion with only the 2 first parameters. (2nd example here)

There is also the option to load using crosstable

rushi1093
Contributor II
Contributor II
Author

Yes I agree columns are different. Actually its coming from text file which has RS and GS to separate the code and count..basically the table is getting populated horizontally but I require the data vertically as shown in the solution table. So that every occurance of code and count will be appended and not extend the columns but rows..kindly check if this helps else i will try to share the text file of data.
rubenmarin

Hi, for the second parameter of subfield you can use Chr() and set the code for RS and GS, maybe you need to do it in some steps: first to split each pair, and a second one to split each pair value.

rushi1093
Contributor II
Contributor II
Author

Pfa for the actual text file. @rubenmarin @jonashertz …in this as you see, RS and GS prefix data gets populated horizontally..I required only count and code column for all such entries. 

rubenmarin

Hi, it will be better if you attach some sample data in a format that we can test to load in Qlik.