Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

chesterluck
Contributor II

Sorting via formula problem

dear all

Sorting.jpg

I try and try to get it work, but unfortunatly I have little success.

I have a date and a number as a joined dimension. I want the dimension to be sorted like this:

12.07.2012_3

12.07.2012_1

12.07.2012_2

13.07.2012_3

13.07.2012_1

13.07.2012_2

Im using a formula to sort the date (the result of it you can see above(Figure)) :

 

if(Schicht = 3, CalDate&1,if(Schicht = 1,CalDate&2,if(Schicht = 2,CalDate&3)))

Any ideas ??

1 Solution

Accepted Solutions
chesterluck
Contributor II

Re: Sorting via formula problem

Found the solution:

 

if(Schicht = 3, Num(CalDate)&1,if(Schicht = 1,Num(CalDate)&2,if(Schicht = 2,Num(CalDate)&3)))

thx all

6 Replies
vivientexier
Contributor II

Re: Sorting via formula problem

It would be easier to create in the script another column to sort your dimension.

chauhans85
Esteemed Contributor

Re: Sorting via formula problem

in charts properties-> sort

check on expression and enter

if(Schicht = 3, CalDate&1,if(Schicht = 1,CalDate&2,if(Schicht = 2,CalDate&3)))

and select ascending or descending there.

Hope this helps

chesterluck
Contributor II

Re: Sorting via formula problem

I don't understand you:

     - Well the formula is entered already, but shows me not what I want.  See orig post

chesterluck
Contributor II

Re: Sorting via formula problem

That would be a possibility, but I'm curious if QlikView is that flexible that I can solve it also in a formula...

chesterluck
Contributor II

Re: Sorting via formula problem

I ve tried also this , but without success :

CalDate& if(Schicht = 3, 1,if(Schicht = 1, 2,if(Schicht = 2, 3)))

chesterluck
Contributor II

Re: Sorting via formula problem

Found the solution:

 

if(Schicht = 3, Num(CalDate)&1,if(Schicht = 1,Num(CalDate)&2,if(Schicht = 2,Num(CalDate)&3)))

thx all

Community Browser