#1
|
|||
|
|||
Using title expressions for chronological sorting
Hi,
I’m trying to use title expressions to prepend a date/time to my item titles, so that they sort chronologically in the Data Explorer tree. QUESTION 1 Currently, items in the tree can be sorted chronologically if their titles can be parsed by Windows as a date or date+time (see http://www.kinook.com/Forum/showthread.php?t=4106). Is there a way to get items to sort in the tree, if the first part of the title is a date or date+time, followed by some descriptive text? For example, say I keep journal items, and use title expressions to prepend a journal date (attribute type: date+time) to the item title, so that the titles in the tree looks like:
Chronologically sorting this list would require UR/Windows to parse the date or date+time from the title while discarding the following text. Predictably, appending the title apparently causes the date parsing to fail, reverting back to a simple string sort. Is there a trick to making this work? Maybe a particular delimiting charater between the date/date+time string and the rest of the title that will silently drop the rest and parse successfully? QUESTION 2 (Related) Since I couldn’t get the sorting described above to work, I tried using the “Custom Insert date/time as:” feature to get a date that is string-sortable, per the help file (see chm::/custom_item_titles.htm). This results in item titles like the following:
However, I also want to mix appointments in there, and have them all sort together.
Since appointments use separate fields for Begin Date and Begin Time, their formatting in title expressions do not follow convention set in the “Custom insert date/time as:” setting, as it only applies to date+time attributes, not date(-only) or time(-only) attributes, I tried using some SQLite functions in the title expression field, and although I got a few to work that were undocumented in UR help, like length() and lower(), I couldn’t get any date/time functions to work, and so couldn’t format the date attributes or time attributes to mimic the custom formatting of the date+time attribute. Nor could I figure out how to somehow “add” an appointment’s Begin Date and Begin Time together to make a single date+time. (When I tried to add a Begin Date and Begin Time together in a title expression, they evaluated to “11”.) SUMMARY In short, I’d like to:
Please advise! I’ve been trying to solve this problem for years, and I feel like I’m soooooo close to figuring it out. UR provides so much insane, awesome functionality, but I just can’t get over this hump. Thanks! Aaron |
Thread Tools | |
Display Modes | Rate This Thread |
|
|