April 24, 2007, 11:50 AM
LEX-IAAcross Month/Day in Graph
Hello Hello,
I'm working on a graph where the dates have to be displayed across Month/Day (i.e May19). I used a define to remove the year. However when I do an across the dates are displayed in alphabetical order.I want them to be displayed in the table order. Can someone tell me how to display month/day in smart dates? From what I have been reading in the previous posts, the reason why it is sorting alphabetically is because of the format alpha.
DEFINE FILE TEST
DATE/YYMD = BOOK_DATE;
DATE_2/A8YYMD =DATECVT(DATE, 'YYMD', 'A8YYMD');
MTH/A4 = EDIT(DATE_2,'$$$$99$$');
MTH_2/A4= DECODE MTH(01 Jan 02 Feb 03 Mar 04 Apr 05 May 06 Jun
07 Jul 08 Aug 09 Sep 10 Oct 11 Nov 12 Dec ELSE ' ');
DY/A4 = EDIT(DATE_2, '$$$$$$99');
MYDATE/A8 = MTH_2||DY;
END
April 24, 2007, 12:31 PM
LeahIf you don't mind the year showing as two digits this works
DATEDIST/MDYT = BOOKDATE;
I don't know what the magic combination if any exists to just have a smart date with just Month and Day only to get an alpha month.
April 24, 2007, 01:05 PM
LEX-IAHi Leah,
Thanks for your suggestion but I don't want the year to show. For this graph I have a combination of 3 years. Showing the year would not be accurate. I really need to show only month/day.
April 24, 2007, 04:19 PM
FrankDutchLex
We had the same problem and my solution is not so nice..
I added the number 01 - 12 in the datestring so
01 jan
02 feb
03 mar etc
but there might be a better solution.
April 24, 2007, 05:15 PM
LEX-IAHere is the solution:
DATE/HYYMD = HDTTM(BOOK_DATE, 8, 'HYYMD');
DATE1/HYYMD=DATE;
MY_DATE/HMtDN=DATE;
* The N removes the save between the month and day. i.e May18 instead of May 18.
if you do want the space: HMtD
Thanks
Lex
April 24, 2007, 07:07 PM
susannahoohh that's very nice, lex
April 25, 2007, 09:14 AM
JockAnother technique I found that works is using I8YYMD instead of A8YYMD. I8YYMD will sort the date numerically instead of alphabetically.
Hope this helps in the future.
-Jock