Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

Dimensions in Ascending Order - How?

Hi Team

  • I have a graph like this below where I am showing the Latest 3 Months (from a Set of 13 months)
  • I have enabled the Dimension Limit as 'Show First 3 Values'
  • Now I want to show the X axis in Ascending Order (Dec-14 Jan-15 Feb-15). HOW?

       (My Sort option is shown in next image)

  • Changing the Expression Sort to Ascending is not helping as it displays - Jan-14  Feb-14  Mar-14

Labels (1)
9 Replies
sunny_talwar
MVP
MVP

Is your [Month/Year] field a date field or text? If it is a date field then you can do a numeric value sort by ascending order. If it is text than you can put this as your sort order in the expression:

=Match([Month/Year], 'Dec-14', 'Jan-15', 'Feb-15')

HTH

Best,

S

Not applicable

If the dimension is in date format enable only the Text A-Z sort option. I think that works.

dmohanty
Partner - Specialist
Partner - Specialist
Author

HI Renato,

Enabling the Tex A-Z gives Jan-14  Feb-14   Mar-14.

This is not needed.   Any more help please

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hi Sunindia,

I can't do a hard coding here.... As it's kind of Rolling Month and will change next month.

Numeric Sort didn't helped.

Any SET ANALYSIS to restrict Latest 3 months from 13 months - to avoid Dimensional Limit ?

sunny_talwar
MVP
MVP

You should be able to use set analysis, something like this maybe:

{<[Month/Year] = {'>=$(=Date(AddMonths(Max([Month/Year]), -3)))'}>}

Assuming [Month/Year] is a date field

Let me know if it doesn't work or if [Month/Year] is a different format.

Best,

S

Anonymous
Not applicable

In the script you can sort the table that has the date field by Ascending and than check Load Order as your Sort option.

MK_QSL
MVP
MVP

When you are creating your Month/Year field, create using Dual as below. This will allow you to sort the data by Numeric value..

Load

  *,

  Dual(Date(MonthStart(Date),'MMM-YY'),Date(MonthStart(Date),'YYYYMM')) as [Month/Year]

Inline

[

  Date, Sales

  15/02/2015, 100

  25/01/2015, 120

  10/11/2014, 130

  12/12/2014, 90

];

simenkg
Specialist
Specialist

Sort by expression and use the expression:
=Max(Date)

vishnus85
Partner - Creator
Partner - Creator

I feel, the best way to deal with sorting of time is to create a numeric field corresponding to the every month and use it as the sort expression. That is, in your case, at the script side you can create a new field by name say 'MonthSort'

Dec-14 should have the MonthSort value as 201412

Jan-15 should have the MonthSort value as 201501

Feb-15 should have the MonthSort value as 201502


Later in the dimension sort tab, check to sort by expression and in the expression field just give MonthSort and make it ascending.