Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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.

Tags (1)
3 Replies
Not applicable

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

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

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

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

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

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

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

Community Browser