Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Date ascending or descending order

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

chauhans85
Esteemed Contributor

Date ascending or descending order

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

Re: Date ascending or descending order

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

MVP
MVP

Date ascending or descending order

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
Contributor III

Re: Date ascending or descending order

hi

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

may it works

thans

rohit

Re: Date ascending or descending order

Hi,

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

Regards

Anand

jldengra
Contributor

Re: Date ascending or descending order

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
Honored Contributor

Re: Date ascending or descending order

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
Contributor

Re: Date ascending or descending order

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

Community Browser