PDA

View Full Version : Data Explorer Sorting Anomaly


armsys
09-06-2010, 05:21 AM
On the Data Explorer pane, sorting will fail after the 2nd period. For example:
2010.07.01
2010.01.03
2010.03.01
2010.07.05
2010.09.07
2010.10.02
2010.02.03
2010.03.05

The sorting works fine for the months but fails for the days, regardless manual or automatic.
Armstrong

quant
09-06-2010, 07:40 AM
you're right, that's strange

armsys
09-06-2010, 07:45 AM
Originally posted by quant
you're right, that's strange
Quant,
Thanks for your confirmation. I discovered it by accident while creating a timeline using yyyy.mm.dd as the item title.
Armstrong

kinook
09-06-2010, 01:24 PM
Download the attached file, extract and double-click DisableSortDateNumericInTree.reg, and restart UR.

armsys
09-06-2010, 05:37 PM
Originally posted by kinook
Download the attached file, extract and double-click DisableSortDateNumericInTree.reg, and restart UR.
Hi Kinook,
Thanks for your fast help. Yes, your solution works brilliantly.
May I know the technical effects of EnableSortDateNumericInTree.reg and DisableSortDateNumericInTree.reg? That's, uf Date Numeric Tree is disabled, how would affect sorting of other item titles?

2010.09.10, for example, is just like any text string. Why does UR treat it as a date?

Thank you.

kinook
09-07-2010, 06:54 AM
If the sort option is enabled (default behavior), when sorting in the tree, UR first attempts to convert the values to dates (using the Windows VarDateFromBstr (http://msdn.microsoft.com/en-us/library/ms221395.aspx) API) and performs a date comparison if conversion succeeds, otherwise it converts the values to numbers and performs a numeric sort if the values look like numbers.

If the sort option is disabled, or the above fails, a regular string comparison is used (using lstrcmp (http://msdn.microsoft.com/en-us/library/ms647488%28VS.85%29.aspx)).

armsys
09-07-2010, 08:29 AM
Kinook,
Thanks for the enlightenment. The itching question here: how could UR discern the various date formats around the world?
yyyy.mm.dd
mm/dd/yyyy
dd/mm/yy
...etc.

I thought all item titles are assumed char string data type.
In UR, it turns out to be a data data type.

Thanks for allowing us to know more the technical details of the UR.

kinook
09-07-2010, 09:00 AM
UR doesn't -- Windows does, based on the date settings in Regional and Language options in the Control Panel.

armsys
09-07-2010, 09:11 AM
Thanks.