COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: cognos05 on 02 Dec 2018 08:57:12 PM

Title: Line chart with expected image attached
Post by: cognos05 on 02 Dec 2018 08:57:12 PM
Hi ,
I am using a cube and has time dimension like
FIscalyear, fiscal months .

In the attached chart has

Jan to december in x axis and Fiscal year as data for 3 years for a specified product .

Since my months are always like jul 2018 or Aug 2018 . How can I achieve this like just having jan to dec and then plotting for FY 2018 etc ..

I can do only one fiscal year in x axis like children(2019 )

Thanks,
Title: Re: Line chart with expected image attached
Post by: CognosPaul on 03 Dec 2018 11:42:13 AM
This is great example of why you need to have separate year and month hierarchies in your time dimension. Fortunately there is a trick you can use to get the previous years against the current year months.

In the series drop zone you should have [measure]. Add a data item with
tuple([measure]
  ,parallelPeriod(
      [Cube].[Time Dim].[Time Hier].[Year Level]
    , 1
    , currentMember([Cube].[Time Dim].[Time Hier])
  )
)

Call that Previous Year.

It's essentially creating a calculated measure that's taking the measure against the same month 1 year back.

For the caption in the axis, set the source type to report expression and use substring to extract the month out.
Title: Re: Line chart with expected image attached
Post by: cognos05 on 14 Dec 2018 11:24:36 AM
How do you change the report expression to get fy 2019 , fy 2018 and fy 2017 with previous year data item.
Title: Re: Line chart with expected image attached
Post by: cognos05 on 14 Dec 2018 01:00:10 PM
IF (extract( month, {sysdate}) < 7)
THEN (cast(extract(year, {sysdate}), varchar(4)))
ELSE (cast(extract(year, {sysdate})+1, varchar(4)))


I have above syntax cannot use it in report expression.