Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ameydiwanji
Contributor III
Contributor III

Custom sorting of Dimentions

Hi,

I am facing problem in sorting the dimension. I have monthly data which i want to sort in reverse order on the basis of months. For eg. I have sales data for Nov'16, Dec'16, Jan'17, Feb'17. Now, i want to sort this data in visualization in such a way that Feb'17 should come first for current year followed by Jan'17, Dec'16, Nov'16.

Can you guys help me??

9 Replies
Chanty4u
MVP
MVP

Hi

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 descending  order. If it is text than you can put this as your sort order in the expression:

=Match([Month/Year], 'Feb-17', 'Dec-16', 'Nov-16')

Chanty4u
MVP
MVP

Mean while check this for better u.standing

Month/Year date field in date sort order

sarvesh
Creator III
Creator III

Hi..Amey,

Try this


If(Customer='$(vFocusCustomer)', 0, 1)

If(Customer='$(vFocusCustomer)', 0, Rank(Sum(Value)))

vinieme12
Champion III
Champion III

OR you can create a custom SortORder by loading an inline table associated with the field you want to sort

and then sort by expression

For example

SortMonths:

Load * Inline [

MONTH,Month_SortOrder

Dec,6

Nov,5

Oct,4

etc.............];

Now sort by expression Month_SortOrder

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ameydiwanji
Contributor III
Contributor III
Author

Thanks a lot for the suggestion but still it is not solved.  I tried this but still the result is coming as Dec'16 first followed by Feb'17, Jan'17 and Nov'16

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

hI,

There are few options you can do

  • Load data in the order you want to show it and on sorting page disable all options (that will default to load order)
  • You can also sort data during load and create dual values for each of them - see this topis as i have explained it in details (your case will be looking at months and attached example is for weeks - but concept is the same).
  • Time Sequence in line chart not in correct order
  • I would suggest converting your text dates to actual dates (numbers with date formatting) - then you will get more flexibility, and you will be able to sort it numericly

regards

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
priyasawant
Creator II
Creator II

You can create a inline

Year, Sr No.

Feb'17, 1

Jan'17, 2

Dec'16, 3

Nov'16, 4

and sort by --> expression --> and select the field Sr No

Not applicable

Why don't you just convert it to a date? date#([Month/Year],'MMM'& chr(39) &'YY') Make sure you check descending order. Does it not work?

Not applicable

Update: Don't convert in the script - apparently there's a bug! (probably to do with the apostrophe) Do it in the sort order field!