COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: gopal.pune05 on 25 Jun 2021 02:07:23 AM

Title: Need to create percentage dynamically
Post by: gopal.pune05 on 25 Jun 2021 02:07:23 AM
Hi Cognos Experts,

I have a requirement where I have to create a column for creating the percentage dynamically.

I have to create the comparison percentage.
In the cross tab report I have my dimension as Supplier Name and I am displaying Full Rate for each supplier in the columns.

Supplier 1          Supplier 2                                                                          Supplier 3 
Full Rate 1         Full Rate 2  | Comparison%(Full Rate1/Full Rate2)                 Full Rate 3 | Comparison%(Full Rate2/Full Rate3)

And So on.

So can I get this requirement done in Cognos Cross Tab Report. Any help would be really appreciated.
Title: Re: Need to create percentage dynamically
Post by: CognosPaul on 25 Jun 2021 02:19:52 AM
Is this a relational or dimensional source? If it's dimensional then it would be a simple matter of doing:

[Full Rate] / tuple([Full Rate],prevMember(currentMember(SupplierHierarchy)))

Relational sources are a little more difficult. Try doing something like

PrevFullRate:
moving-total([Full Rate],2) - [Full Rate]

That should give you the value for the previous column. Then do [Full Rate] / [PrevFullRate]

If you have something in your rows, then the moving total should look like this:
moving-total([Full Rate],2 for [Row Data item]) - [Full Rate]
Title: Re: Need to create percentage dynamically
Post by: gopal.pune05 on 25 Jun 2021 02:31:08 AM
Its a relational model
Title: Re: Need to create percentage dynamically
Post by: CognosPaul on 28 Jun 2021 11:59:01 AM
Is moving-total([Full Rate],2) - [Full Rate] working?
Title: Re: Need to create percentage dynamically
Post by: gopal.pune05 on 09 Jul 2021 05:41:21 AM
Hi Paul,

Unfortunately the calculation is not giving me the correct value of the percentage