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

Sort sequence when sorting by expression

When sorting codes HC, PD, SO, WD, WO, XO alphabetically they come out in proper sequence.  However, when sorting the associated description using the codes in a "sort by expression", the resulting sequence is HC, PD, WD, SO, WO, XO.

It appears to me that the sort is using the last character as the primary sort (hence  C(H), D(P), D(W), O(S), O(W), O(X)...

Should I be raising this as a bug?  Or have I missed a setting somewhere?

Bob

2 Replies
Not applicable
Author

Sort by expression looks at the numeric evaluation of the expression.

You could use the match function.

For example: match(fieldname,'HC','PD','WD','SO','WO','XO')

Regards,

Bert

Not applicable
Author

Thanks, Bert. 

That works.  It does mean hardcoding the values into the expression, though, which is something I was trying to avoid..

Bob