Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is Sorting By an Expression Borked in 10.SR1?

I've been having trouble with sorting since I first started using QlikView a couple of months ago, but it seems to have gotten worse since installing SR1 last week. Problem #1 is that tables seem to laugh at the Sort tab, and only pay attention to which columns have been sorted via the context menu in the frontline UI, but before I can even get to that, I'd like to get a simple list box sorting correctly.

My data includes two fields, ServiceRep and ServiceRepLastName. I'd like to display the former and sort by the latter (actually, sort by the combination of the two, to handle reps with the same last name). So I create a list box for ServiceRep and set Sort to Expression: ServiceRepLastName & '_' & ServiceRep. The output is sorted apparently randomly, neither by ServiceRep nor by ServiceRepLastName.

So I create another list boxes based on ServiceRepLastName. It sorts fine if I just set it to Text, but sorting by Expression: ServiceRepLastName or ServiceRepLastName & '_' & ServiceRep gives the same bizarre ordering the previous list box.

So I create another list box, populated with ServiceRepLastName & '_' & ServiceRep. Again, it sorts fine when sorting by Text, but sorted by Expression: ServiceRepLastName or Expression: ServiceRepLastName & '_' & ServiceRep, I get garbage, though not the same order as the two previous tests.

I know the expression is fine, because it looks exactly like I expect it to the the third list box. Has anyone else seen this behavior? Should I raise it as a bug, or am I missing something simple? I could use some cumbersome workaround, like pre-sorting the data and sorting by load order, or creating a separate table for these names, adding a serial number, and sorting by that... but I'd rather the software just sorted by the expression given.

FYI, using just "ServiceRepLastName" as my sort expression does not work either. I've attached a stripped-down version which truncates the names, as a half measure to protect the privacy of the reps in question.

1 Solution

Accepted Solutions
nathanfurby
Specialist
Specialist

Same thing happens in Version 9 SR4.

Solution not an explanation:

Add the ServiceRepLastName as a Dimension and then hide it. Then just sort on 'ServiceRepLastName' A->Z first then 'ServiceRep' A->Z

View solution in original post

6 Replies
Not applicable
Author

Agreed. In general, something is funky with the way sorting is behaving.

In short, it seems like the sort priority selected seems to still affect the order even if no options on the right are checked.

Furthermore, like Jon said, user-sorting doesn't seem to change any of the data order (and doesn't reverse apparently either - or is this intended)?

nathanfurby
Specialist
Specialist

Same thing happens in Version 9 SR4.

Solution not an explanation:

Add the ServiceRepLastName as a Dimension and then hide it. Then just sort on 'ServiceRepLastName' A->Z first then 'ServiceRep' A->Z

Not applicable
Author

Glad it's not just me!

@jared.wisham: One question: what do you mean by sort priority? Is there a way to choose the order in which sorting is applied, when you have more than one option checked? That would be nice to have.

@NathanFurby: Well, that's a workaround, but at least it's a fairly simple one. Thanks, I'll use that for now.

The phrase "sort expression" returns no results in the Customer Portal, so I guess I'll open a bug report. If anyone else has, or has not, seen this behavior, please let me know. I can only confirm on 10.SR1, though I think I saw the same behavior on 10.IR.

Not applicable
Author

Yeah, in a typical object property box, you can go into the "Sort" tab and promote/demote fields as you see fit in order... that's the thing though, it seems like even if things are not checked off on the right (individual methods of sorting) it will still give whomever is on 'top' the first priority for sorting.

What I do is I make sure and put all the checked items in the correct respective orders at the top, then leave all the unchecked (unnecessary) fields beneath them, disregarding order at that point for the most part except for personal preference.

Correct me if I'm wrong here guys, but that's the 'behavior' as I see it right now.

Not applicable
Author

Ah, gotcha, I was talking about reordering the sort options *for a single dimension*, you were talking about changing the sort order (priority) for *several different dimensions* which each have sorting.

The bug report is case #00054713, if anyone wants to follow along, if that's even possible.

Not applicable
Author

Correction: that's the case number, the bug number is 37615.