Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to transpose a straight table

hello there,

i have a straight table looking like below:

 

group count
A132
A156
A78
B24
B66
C89
C109
C172
C201
C33
C27
D49
D55
D61
D

18

I want to make it look like this:

 

group count1count2count3count4count5count6
A13215678
B2466
C891091722013327
D49556118

CAN anyone help? is there a easy way?

thank you!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You'll have to transform the data in the script for that. I recommend you don't try to use a straight table, but a pivot table.

LOAD

     group,

     count,

     'count' & autonumber(count, group) as newfield

FROM

     ...source data...

     ;

Once you've transformed the data like above you can use group and newfield as dimensions in a pivot table and sum(count) as expression. In the pivot table drag the field newfield to the right above the expression so it gets pivoted to columns.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You'll have to transform the data in the script for that. I recommend you don't try to use a straight table, but a pivot table.

LOAD

     group,

     count,

     'count' & autonumber(count, group) as newfield

FROM

     ...source data...

     ;

Once you've transformed the data like above you can use group and newfield as dimensions in a pivot table and sum(count) as expression. In the pivot table drag the field newfield to the right above the expression so it gets pivoted to columns.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi Gysbert,

Thanks a lot! i tried it and it worked!

thanks again!