Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

special sort of column

hi

as an example i would like to sort the following columns values

according to the period and year.

so for example the value p03 11 should come before p08 11 in the list and p12 12 should be last in the list.

it is possible to add a sorting function in Qlikview on the column for special sort?

Period

p08 11

p10 11

p03 11

p09 11

p12 12

p06 11

Best

Brad

1 Solution

Accepted Solutions
MarcoWedel

in this case, one solution could be to simply load it as date using the date#() function:

LOAD Date#(Period, 'pMM YY') as Period

Inline [

Period

p08 11

p10 11

p03 11

p09 11

p12 12

p06 11

p01 12

p02 12

p01 13

p02 13

p03 13

p01 14

p02 14

];

QlikCommunity_Thread_149407_Pic2.JPG

hope this helps

regards

Marco

View solution in original post

16 Replies
Anonymous
Not applicable
Author

you should use makedate

makedate (num(right(Period,2), num(mid(Period,1,2) as Datefield

you get the numbers year and month from your field Period

using makedate you make a datefield which you can sort

MarcoWedel

has the list to be ordered first by year or by period?

Not applicable
Author

first by period then year

alexandros17
Partner - Champion III
Partner - Champion III

in the sort tab of your page check the box "TExt"

let me know

Anonymous
Not applicable
Author

makedate requires 4 Digit for year

so use

makedate (2000+num(right(Period,2), num(mid(Period,1,2)) as Datefield

Not applicable
Author

thanks Rudolf.

however i would like to present the field as it is t ex with the leading p? can i do this in the interface?

Best

Brad

Anonymous
Not applicable
Author

sure, so convert it the date to text wioth preceding "P" and

in the sort tab you sort by mid(Datefield,1,6)

jaygarcia
Contributor III
Contributor III

Hi Bradley

Actually there's nothing special in the sorting of Period. If you choose "Text" and from A->Z will do the work

Hope it makes sense,

J

MarcoWedel

default order for this field (by text) should be all right then!?!?

QlikCommunity_Thread_149407_Pic1.JPG

regards

Marco