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

Hierarchy order in Pivot table

Hello,

I'm new to QlikView and I have this problem:

I have a hierarchy table. Some of the fields are:

LineDescription1, LineDescription2, LineOrder.

I created a pivot table with these dimensions:

LineDescription1, LineDescription2

and for LineDescription1 I used the =LineOrder expression in the sort tab.

The problem is that the sort is applied only for those lines who have no children.

For example, if my table is:

[L1, -, 1]

[L2, -, 2]

[L2, L21, -]

[L2, L22, -]

[L3, -, 3]

the sort is correctly applied only for L1 and L3.

I created a listbox for the LineOrder field, and the values for the lines with children (in this example: 2) are blocked for selection.

Can you help me with this problem?

Thank You!

5 Replies
simenkg
Specialist
Specialist

You are using LineOrder without an aggregate function. I'm guessing that there are more than one possible value for LineOrder on the lines with children.

Change the sorting expression to =Max({1}LineOrder} and see if that helps.

Regards

SKG

Not applicable
Author

Thank you for your answer. I know it's a silly question, but I want to ask you what is the role of that {1}?

simenkg
Specialist
Specialist

The {1} means that it disregards user selections.

If you tells an expression to disregard the selection on LineDescription1, but do not tell the sorting expressions to do the same, then LineOrder will not exist for the lines with another LineDescription1. In stead of telling the sorting expressions to disregard specific selections we tell it to disregard all of them.

Not applicable
Author

I understood, thank you very much!

Not applicable
Author

I have another question.

If my configuration is like that:

[L1, -, 1]

[L2, L1, 1]

[L3, L1, 2],

for the line L1, =Max({1}LineOrder) returns 2 for LineOrder, but I want the order to be 1. How can I do that?

Thank you again!