COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: yannunderw on 14 May 2025 03:53:36 AM

Title: Month in bar chart
Post by: yannunderw on 14 May 2025 03:53:36 AM
Hello,
I'm using Cognos Analytic 12.0.3. In a bar chart, I want to display the month (in abbreviated letter format, like Jan., Feb., etc.) on the x-axis. My date field is in the format 2021-04-08T01:56:28. Do you have any suggestions, please?
Thank you.
Title: Re: Month in bar chart
Post by: bus_pass_man on 14 May 2025 07:58:40 AM
extract ( datepart , datetime_expression ) or _month ( date_expression ) will get you the month number value, which you could then use in a case statement to get the strings you want. 

The question I have is: Why hasn't your modeler done that for you? For that matter, it would seem to me that these sorts of things (month and day names and abbreviated month names ) should be created during ETL, before the modeler has to.
Title: Re: Month in bar chart
Post by: dougp on 14 May 2025 12:04:03 PM
QuoteMy date field is in the format 2021-04-08T01:56:28.

Do you mean your varchar column contains values that look like dates?  Or are you working with a datetime data type (which doesn't have a format)?  If it's a datetime, can't you just use the numeric format options for the axis labels?