COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS Query => Topic started by: Cogno-Gulf on 15 Apr 2009 06:24:57 PM

Title: How can I get the month on my charts to stay in the right order?
Post by: Cogno-Gulf on 15 Apr 2009 06:24:57 PM
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
Title: Re: How can I get the month on my charts to stay in the right order?
Post by: HalfBloodPrince on 14 Nov 2011 11:54:52 PM
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,