# QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
Contributor II

## Sorting via formula problem

dear all 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
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
Contributor II

## Re: Sorting via formula problem

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

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

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

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...

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)))

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