Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
thanks however that groups all the periods 01 together so for example when sorting by text unfortunately
p01 12
p01 13
p01 14
best
Brad
You could load the period as a dual number and text in the script and then just sort on numeric value with the display being text?
isn't that what you specified with the order sequence period first, year second?
hello Marco!
i should be more clear with both the period and the year taken into consideration it should sort.
for example
p01 12
p02 12
p01 13
p02 13
p03 13
p01 14
p02 14
best
Brad
hi rudolf.
thanks i have now attempted this as well but still it is bugging.
have a look at the screen shot below.
I think this could be one way:
Add to your Load a field with the conversion of Period as Date format, and then you sort by that date field. Something like this:
LOAD *,
date#('01'&'/'&(right(left(Period,3),2))&'/'&(right(Period,2))) as PeriodDate
INLINE [
Period
p08 11,
p10 11,
p03 11,
p09 11,
p03 13,
p12 12,
p06 11,
p03 12,
];
Best regards,
J
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
];
hope this helps
regards
Marco