Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

Sort in Straight Table

Hi Experts,

I need to sort the data on Date

I have Date field with to Two Dates

1 - 12/31/2014

2 - 01/01/2015

Now its looking like

Ex:

12/31/2014

12/31/2014

01/01/2015

12/31/2014

01/01/2015

12/01/2014

I want it to be 12/31/2015 first and 01/01/2015 in order

Like:

12/31/2014

12/31/2014

12/31/2014

01/01/2015

01/01/2015

01/01/2015

I have removed other sorting options on other Dim and Expr

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Move the date field to the top of the sort priority list on the Sort tab.

And check that your dates are real dates and not text values. Try adding the date field to a list box and changing the Number format to one of the number formats.

If your date values are text values the use the date#() function in the script to create real date values: date#(MyDate,'MM/DD/YYYY') as MyDate.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Move the date field to the top of the sort priority list on the Sort tab.

And check that your dates are real dates and not text values. Try adding the date field to a list box and changing the Number format to one of the number formats.

If your date values are text values the use the date#() function in the script to create real date values: date#(MyDate,'MM/DD/YYYY') as MyDate.


talk is cheap, supply exceeds demand
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If these are proper QV dates, you can just sort them numerically. Go to the sort tab and ensure that the numeric option is ticked.

If they are strings, I recommend that you convert them to date during the load - something like

     LOAD ...

          Date(Date#(Date), 'MM/DD/YYYY')) As Date,

          ...

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein