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: 
Not applicable

Unexpected sort on a Calculated Dimension: [Line] & ' ' & [Label]

Please see attached Qlikview.

Simple Load Script:

sort load script.PNG

Simple List Boxes, the third of which doesn't sort how I expect.

unexpected sort order.PNG

Now I can think of various confounding factors:

  • The calculated dimension that combines two dimensions: [Line] & ' ' & [Label]
  • The fact that I load the same dataset, and then reload it again

And so I can workaround and achieve my expected behavior

  • Separate Line and Label dimensions (could use a Chart if needed)

But I can't wrap my head around why these things (might) cause the unexpected the results.

3 Replies
Not applicable
Author

By the way, I say I "expect" Text(Line) to sort like this:

1a

1b

2

3

4

5

6

7

8

9

10

11

12

13a

13b

But if it were lexicographic sorting, wouldn't it be:

10

11

12

13a

13b

1a

1b

2

3

4

5

6

7

8

9

As demonstrated here in my Chrome Javascript console:

l=['1a','1b','2','3','4','5','6','7','8','9','10','11','12','13a','13b']

["1a", "1b", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13a", "13b"]

l.sort()

["10", "11", "12", "13a", "13b", "1a", "1b", "2", "3", "4", "5", "6", "7", "8", "9"]

Not applicable
Author

And I wasn't sure why these expressions behave differently:

  • Text(Line)
  • Num#(PurgeChar(Num, 'abcd'))
Not applicable
Author

Particularly if I first sort on "Expression" Num#(PurgeChar(...)), Ascending but I also check the "Text" checkbox, what's the difference?