How to create a Ratio in Cognos Report studio Reports?



How to create a Ratio in Cognos Report studio Reports?..

Answer / the_xxx

RATIO_TO_REPORT

This rank function calculates the ratio of a value to the
sum of the values for the entire set.
Syntax

RATIO_TO_REPORT( numeric )

Parameters

*

numeric-- Any numeric data type expression, typically
a reference to a numeric column.

Return Type

DOUBLE PRECISION.
Remarks

Returns a number for each row in the set that is the row’s
ratio to the sum of the entire set. When expression results
in NULL, the function returns NULL. When the sum of the set
is zero (0), the ratio is also zero.

Note: This function cannot be used as an argument in a set
function, moving set function, or rank function. For
example, SUM(RATIO_TO_REPORT(...)) is illegal.
Example

Determine what percentage each product sales is to the total
sales of all products for the last 20 weeks:

SELECT prod_description DESC,

SUM(dollars) as sales,

RATIO_TO_REPORT( SUM(
li_amount )) * 100 AS ratio_dollars

FROM lineitem, product

WHERE lineitem.li_prod_id = product.prod_id

GROUP BY prod_description;

DESC SALES RATIO_DOLLARS

Widget 896931.15 12.88

Basket 514830.00 7.39

Football 507022.35 7.28

Oil Drum 503493.10 7.23

Computer 437863.00 6.29

Chair 429637.75 6.17

Desk 424215.00 6.09

Mesh Bag 421205.75 6.05

Shoelace 417261.00 5.99

Powder 397102.50 5.70

Telephone 394086.50 5.66

Cord 392377.75 5.64

Mouse 389378.25 5.59

Monitor 305859.75 4.39

Case 294982.75 4.24

Cup 236772.75 3.40

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Cognos Interview Questions

what is filter?give me one example that you created a report in your project?

3 Answers   IBM,


What is set to be Cognos configuration?

0 Answers  


Can we create a web page where the report directory and the output can be viewed directly across cognos connection?

2 Answers   TCS,


what is the difference between group and association?

5 Answers   IBM,


Hi, I Want To Display The Report. From MOnday To Friday By Using Date Prompt.PLs Expain To Me...

1 Answers  






Hi I have Columns A, B, C, D, E in a Crosstab Report, Cost Budget Column A Column B Column C Column D Column E Total of A+B+D+ E Product 1 100 200 300 400 500 1200 Product 2 500 300 400 500 800 2100 Column A Column B Column C Column D Column E is coming from the Query Item: Category I dont want to include C Column value in the Total Column Column Chas to display in the Crosstab Report how to achieve it Any idea Thanks Sumith

2 Answers  


Hi i want know mean and difference b/w render variable,conditional block and style variable please reply about them please be kind towards me

3 Answers  


what are summary filters? grouped filters?

3 Answers   IBM,


write the sql query to display 5th and 10th row in a table?

5 Answers   CTS, IBM,


-----------------What is Determination Model?

0 Answers  


How can we do the unit testing?

3 Answers   Logica CMG,


How to move reports one server to another server?

2 Answers   Wipro,


Categories