Author Topic: How can I get the month on my charts to stay in the right order?  (Read 3453 times)

Offline Cogno-Gulf

  • Associate
  • **
  • Join Date: Apr 2009
  • Posts: 1
  • Forum Citizenship: +0/-0
Hello All,

I have two charts with similiar scripts, but on the charts display the data on the differently. I want to have the month name to appear in order. One has is in the correct calendar order and the other has it in alphabetical order. Can someone help.

Here is my script for the correct order of how the THEN variable appears:
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-01-01 and 2009-02-01) then ('JAN') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-02-01 and 2009-03-01) then ('FEB') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-03-01 and 2009-04-01) then ('MAR') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-04-01 and 2009-05-01) then ('APR') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-05-01 and 2009-06-01) then ('MAY') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-06-01 and 2009-07-01) then ('JUN') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-07-01 and 2009-08-01) then ('JUL') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-08-01 and 2009-09-01) then ('AUG') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-09-01 and 2009-10-01) then ('SEP') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-10-01 and 2009-11-01) then ('OCT') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-11-01 and 2009-12-01) then ('NOV') else
if([SAV-Tables].[PURCHASE_ORDERS_MASTER].[CUTDATE] between 2009-12-01 and 2010-01-01) then ('DEC') else null

Here is my script for the incorrect order of how the THEN variable appears:
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE]between 2009-01-01 and 2009-02-01) then ('JAN') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-02-01 and 2009-03-01) then ('FEB') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-03-01 and 2009-04-01) then ('MAR') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-04-01 and 2009-05-01) then ('APR') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-05-01 and 2009-06-01) then ('MAY') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-06-01 and 2009-07-01) then ('JUN') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-07-01 and 2009-08-01) then ('JUL') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-08-01 and 2009-09-01) then ('AUG') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-09-01 and 2009-10-01) then ('SEP') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-10-01 and 2009-11-01) then ('OCT') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-11-01 and 2009-12-01) then ('NOV') else
if ([SAV-Tables].[PURCHASE_REQUESTS_COMMON].[REQUESTDATE] between 2009-12-01 and 2010-01-01) then ('DEC') else null
 

Offline HalfBloodPrince

  • Community Leader
  • *****
  • Join Date: Nov 2011
  • Posts: 240
  • Forum Citizenship: +9/-1
First Sort ur date column ascending order. then for this calculated column go to Advance sort add this calculated column  below the Date column.

Thanks,

 


       
Twittear