COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Robl on 05 Feb 2015 08:18:47 AM

Title: Cube Bar Chart Month Format
Post by: Robl on 05 Feb 2015 08:18:47 AM
I have a fairly standard cube with a date dim.
When I include the Month on a report bar chart the values on the axis are shows as "2014/Jun"
This displeases me, I want them to show "Jun" or "J".

Before I go and add a load of "short name" values in my different date dims does anyone know a quick way to format this.

Normall on a date I'd just use the date format of MMM or MM, but it doesn't seem to be a date, it's a string.
(well, actually it's a default label of a mun)
Title: Re: Cube Bar Chart Month Format
Post by: MFGF on 05 Feb 2015 08:39:13 AM
Quote from: Robl on 05 Feb 2015 08:18:47 AM
I have a fairly standard cube with a date dim.
When I include the Month on a report bar chart the values on the axis are shows as "2014/Jun"
This displeases me, I want them to show "Jun" or "J".

Before I go and add a load of "short name" values in my different date dims does anyone know a quick way to format this.

Normall on a date I'd just use the date format of MMM or MM, but it doesn't seem to be a date, it's a string.
(well, actually it's a default label of a mun)

What you are seeing here is the defined caption of each month member in the cube. It's not a date - it's a descriptive caption defined within the cube itself.

The simplest and easiest way to change this is to change the caption format in the cube. If you go to the properties of the Month level in the dimension map in Transformer, you can set the format on the Time tab. Just be aware of the implications of making the change, though - you would end up with a slew of members with different MUNs and the same caption - eg [Yourcube].[Time].[Time].[Month]->:[PC].[@MEMBER].[20130601-20130630] and [Yourcube].[Time].[Time].[Month]->:[PC].[@MEMBER].[20140601-20140630] are different month members but both would have a caption of "Jun". In this report it might not be an issue, but in a report where only the month level is used and there are multiple years, it could be very confusing.

Cheers!

MF.
Title: Re: Cube Bar Chart Month Format
Post by: Robl on 05 Feb 2015 08:44:10 AM
If it's a change to the cube I'll go with my first plan and set up a calculated Short Name for the month.
That way it can be used if needed in a chart but the full year/month is shown on other reports.
Title: Re: Cube Bar Chart Month Format
Post by: MFGF on 05 Feb 2015 09:04:38 AM
If it's just for this report, how about a query calc:

substring(caption([Your Month level]),6,3)

Would that work?

MF.
Title: Re: Cube Bar Chart Month Format
Post by: Robl on 06 Feb 2015 07:23:18 AM
That would probably work.
But I need the same format for a dozen charts.

Also, I can pretty much guarantee that sooner or later someone will ask to change all the reports to something else.
So Short Name works.