Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Sort by Expression


Another question. I am trying to sort by expression. My dimensions are Item.Full Name,  Item.Sales description, and Item.Preferred Vendor Full Name. 

The expressions calculate Qty. on Hand, 1 shows the Reorder Point and 1 shows the Build Point (depending on the Item Type) and then I have a column for the avg usage.

I created a sort by expression that sorts the first dimension Item.Full Name

If([Item.Reorder Point]<=[Item.Quantity On Hand],1,If([Item.Build Point]<=[Item.Quantity On Hand],2,If(IsNull([Item.Reorder Point] or [Item.Build Point]),3)))

The idea is to show the items that are low first (the Qty. on Hand value turns red if < or = to the reorder or build point, whichever applies) and then to show the rest with the Qty. on Hand value in green.

However, when I scroll through, it starts out perfect, all red, but then I see a whole bunch of green and red quantities interspersed throughout the table. Can't discern why. According to the table, the Qty. on Hand is clearly more than the reorder or build point and items lower down, the QOH is = or < the reorder or build point.

Let me know if you need more clarity.


Labels (2)
11 Replies
Contributor III
Contributor III


In the end, I simplified the issue by creating a separate dashboard for the Item Type associated with Build Points (as opposed to Reorder Points). This allowed me to use the simple Sort expression If([Item.Build Point]>=[Item.Quantity On Hand],1,2) and If([Item.Reorder Point]>=[Item.Quantity On Hand],1,2) respectively. This worked perfectly for me and ordering the SPB items is a distinct process anyway. 

Thanks again for the advice. I think I was making the issue overly complicated in an attempt to save space.

View solution in original post


I'm glad you got it worked out!

Have a great day!