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

Date ascending or descending order

Hello,

I have an excel file (*.csv) which has one filed that contains timestamp values Ex. 07/21/2011 16:40:43, etc...

Now i have manged to convert into Date format 'MM/DD/YYYY'.

Chart Dimension: Date(Date#(Left([Event Timestamp],10),'MM/DD/YYYY'),'MM/DD/YYYY')

But how can i sort above dimension by ascending/descending order? I have tried several option using Sort tab but no luck.

Any idea?

Thanks,

Dinesh

10 Replies
its_anandrjs

Hi,

As my understanding you need to sort the data of the date column by

Sort tab -> Expression -> Ascending/Descending -> Date column

By this you sort the date field

Regards

Anand

SunilChauhan
Champion
Champion

use this into script

Date(Date#(Left([Event Timestamp],10),'MM/DD/YYYY'),'MM/DD/YYYY') as yourfieldName

take yourfieldName into chart

go to chat and sort ascending/descending order

hope this help you

Sunil Chauhan
its_anandrjs

Hi,

See the attached sample there is two list boxes one is in Asc and other is in Desc see it properties in Sort tab.

Regards

Anand

swuehl
MVP
MVP

If your conversion / parsing to date format was succesful a sort ascending / descending using "numeric value" in sor tab should work.

Please check with an expression to your list box, that the date parsing really was succesful, use

=num(YOUREXPRESSIONorDATEFIELD)

as expression,

you should get integer values only.

Regards,

Stefan

rohit214
Creator III
Creator III

hi

use Sort tab -> Expression -> Ascending/Descending -> Date column

may it works

thans

rohit

its_anandrjs

Hi,

See the attached sample and the image file it will clear you.

Regards

Anand

jldengra
Creator
Creator

Hi,

It is clear when sorting dates in a list box when the field is the date, and it functions properly.

But if the field is not the date, and I try to sort by another field containing the related date, it fails applying a different sorting that I cannot understand.

I had a list box that must show the name of a season, and each season had an initial date related.

So, I created the list for the name of season field, and I tried to sort from the Sort tab, selecting the related date field as Expression, and it does not sort properly the list, some of the items seem ordered but some are missplaced, and I cannot understand what QlikView is doing.

The date related field has been loaded from a DateTime field from a SQL Server table.

Sokkorn
Master
Master

Hi dpatel,

Go to Sort tab ==> Check on Expression ==> Past your code into expression box (Date(Date#(Left([Event Timestamp],10),'MM/DD/YYYY'),'MM/DD/YYYY'))

Regards,

Sokkorn

jldengra
Creator
Creator

I have finally understood what happened. There were some different dates related to each season name, not only one, and QlikView was confused when sorting. Applying the MIN group function to obtain the earliest initial date for each season makes the sorting work fine.

Thank you anyway.

Regards,

J.L.Dengra