COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: frankrss on 28 Aug 2019 06:04:00 AM

Title: List Month Names between a Range of Dates
Post by: frankrss on 28 Aug 2019 06:04:00 AM
Hi, Can someone please let me how how to get a list of the month names between a range of dates.  For example, the begin date is 01-feb-2019 and the end date is 12-may-2019. I would like to get a list of the months names: Feb, Mar, Apr and May.

Thanks
Title: Re: List Month Names between a Range of Dates
Post by: Rafiq_123 on 31 Aug 2019 01:13:27 PM
Try creating a data item, in that use the column name where date cake are stored in extract (). For eg. Extract( month, create_dt).
This will give you the month number. Create ante data item and use case statement to give u the month name based on the number.

DataItem1 -> extract (month, create_dt).
DataItem 2 -> case when DataItem1 = 1 then 'Jan'
Case when DataItem1 = 2 then 'Feb'
And so on.

In the query use the dates as filter to get the result for months between 2 dates.

Hope this helps.

Rafiq

Quote from: frankrss on 28 Aug 2019 06:04:00 AM
Hi, Can someone please let me how how to get a list of the month names between a range of dates.  For example, the begin date is 01-feb-2019 and the end date is 12-may-2019. I would like to get a list of the months names: Feb, Mar, Apr and May.

Thanks