COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognovice on 22 Mar 2018 09:29:01 PM

Title: Percentage of Total Value for each row in a list report
Post by: cognovice on 22 Mar 2018 09:29:01 PM
Hi All,
I want to create a new column (% of Total_Value) for each row of information which calculates % of Total_Value column with respect to grand total.  I have attached the sample report header with one row of information. 

Grand total of Total_Value (Column R) is 4,696,873.36

% of Total_Value for row 1 should be (Column R / Grand Total of Total_Value * 100) which is nothing but (1219.66/4696873.36)*100 = 0.2596

Where as what I am getting is 0.0008199 which is wrong.

Could you please assist me in achieving the above.

Regards,
R
Title: Re: Percentage of Total Value for each row in a list report
Post by: hespora on 23 Mar 2018 03:09:43 AM
Well, what's you definition for the [% of total_value] column? It should be (on relational):


[Total_Value]
/
total(
  [Total_Value]
  for report
)

Possibly replce "for report" with other aggregate levels if you want to divide by subtotals
Title: Re: Percentage of Total Value for each row in a list report
Post by: cognovice on 27 Mar 2018 12:07:21 AM
Hi Hespora,
Thank you very much for your response.  It worked.


Regards,
R
Title: Re: Percentage of Total Value for each row in a list report
Post by: hespora on 27 Mar 2018 02:13:18 AM
Wonderful, glad I could help!