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: 
Rajkumar
Creator
Creator

Sort model based on latest week in pivot table

Dear All,

Can anyone help me to sort model based on latest week in pivot table.

sample data:

week
Model w45    w44   w43   w42
M1           2         6                     5
M2         6                        5          4
M3                    1
M4        7         5            4
M5         8
M6                   5                            5

1 Solution

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

As your sorting expression use; see also attached file:

=aggr({<Week = {"$(=FirstSortedValue(Week, -aggr(num(replace(only(Week), 'w','')), Week)))"}>}sum(Value), Model)

Sorting.png

 

View solution in original post

3 Replies
Kushal_Chawda

how your week is calculated?

Rajkumar
Creator
Creator
Author

 

Week field ex. w1 to w 52

lorenzoconforti
Specialist II
Specialist II

As your sorting expression use; see also attached file:

=aggr({<Week = {"$(=FirstSortedValue(Week, -aggr(num(replace(only(Week), 'w','')), Week)))"}>}sum(Value), Model)

Sorting.png