Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

how do i pivot this?

i guess i'm missing something..

i have this table:

id, value1, value2,

1, 10, 20

1, 15, 30

2, 60, 44

2, 45, 33

....

i need this pivot/table:

value1 ,sum(value1)

value2, sum(value2)

and then a split on id on the top.

3 Replies
Not applicable

That looks not like something I have ever seen in QV.

You put columns in lines and add a dimension that is also used in the expression ... ???

Then you want the id on top of that.

The only thing I could create that comes near that is two pivot tables on top of each other. And those barely made sense anymore.

What you can create of course is a pivot table with dimensions id, value1 and value2 and then add the expressions as mentioned.

But perhaps someone else has a good idea for this 🙂

amien
Specialist
Specialist
Author

Thanks for your reply ..

You put columns in lines and add a dimension that is also used in the expression ... ???

Then you want the id on top of that.

yap .. thats about it 🙂

trying this also to do this with a load resident .,. but cant get it working

Not applicable

Thought of this this morning 🙂

You can use a new dimension to designate the value type (1 or 2).


Test2:
LOAD * INLINE [
id2, valuetype, value
1, 1, 10
1, 1, 15
2, 1, 60
2, 1, 45
1, 2, 20
1, 2, 30
2, 2, 44
2, 2, 33
];