Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

transpose table

Hey all,

I load tables with following structure:

ID201420152016
11526
212525
n.........

Every table represents one list. So I have for example 2 lists with the shown structure. While loading I use "Join load" so I end up with one QlikView table containing all information. Result is 4 fields, ID, 2014, 2015 and 2016. Now I would like to realize a diagramm with two dimensions. One dimension (first one) should give information about the values related to the year. The second dimension contains information about the list. Means the diagramm should look like this:

example_bar_chart.png

IMHO the diagramm can't be realized with the existing table strucutre. so first question: Is it possible and I just messed it up?

However I assumed I need an other table structure. So I would transpose the existing table to end up with this structure:

IDYearValueList
1201415list_1
120152list_1
120166list_1
12014from list 2list_2
12015from list 2list_2
12016from list 2list_2
2201412list_1
2201552list_1
220165list_1
22014from list 2list_2
22015from list 2list_2
n.........

And here comes the second question: How do I correctly transpose the existing table structure to end up with my suggestion? AND ist it even the correct way to realize this bar chart?

Thanks a lot to every single reply!

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try to use CrossTable() like below

List:

LOAD

'List1' AS DataType,

*

FROM List1;

Concatenate(List)

LOAD

'List2' AS DataType,

*

FROM List2;

CrossTable(Year, Value, 3)

LOAD

*

FROM List;

DROP TABLE List;

Hope this helps you.

Regards,

Jagan.

View solution in original post

3 Replies
Ralf-Narfeldt
Employee
Employee

If you do Crosstable loads of the two tables, they should look like what you want to achieve.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try to use CrossTable() like below

List:

LOAD

'List1' AS DataType,

*

FROM List1;

Concatenate(List)

LOAD

'List2' AS DataType,

*

FROM List2;

CrossTable(Year, Value, 3)

LOAD

*

FROM List;

DROP TABLE List;

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hey Jagan,

thanks a lot. Thats exactly what I was looking for!!! Just that I need to use "Resident" instead of "From", but everything else worked out.