Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Wrong order for dimensions in a pivot chart

Hi,

in a pivot chart I have year and month dimensions.

The month dimension is built in this way: pick(num(right(Month_Year,2)), 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'). For the order (crescent) I have specified the same expression in the match(...) statement, but the order isn't rigthly executed when I select one or more years in a list box. I have also specified the order for Year dimension that precedes the month dimension.

Any suggests to me, please? Thanks

2 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi,

I think you could create your month dimension use Dual values. For example, create january as dual('January', 1).

On the Sort tab, select numeric value and it will automatically use the numeric part of it.

Hope this helps you.

Regards,

Fernando

johnw
Champion III
Champion III

Easiest is if you can settle for the three character abbreviations.  Then you can use real QlikView date fields, not numbers and text.  So if your Month_Year field looks like YYYYMM, do something like this in the script:

,date(date#(Month_Year,'YYYYMM')) as Month_Year
,month(date#(Month_Year,'YYYYMM')) as Month

If you want the full names, you could do the above AND override the abbreviations with the full names:

SET MonthNames='January;February;...etc...';

I think that would work, but I think it make the abbreviations inaccessible.

And yeah, as Fernando says, dual() would do the trick too.  I just tend to prefer using real dates and real date fields.  Once you start using numbers and text, it gets harder to do date manipulation.  Anyway, here's dual, I think:

,dual(date(date#(Month_Year,'YYYYMM'),'MMMM') // MMMM is full name
    ,month(date#(Month_Year,'YYYYMM')) as Month

Then sort numerically as he said.