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

Hi I have Most updated Cognos dumps like COG-112(ReportAuthor),COG-122(Admin),COG-132(Meta Data Modeller). 100%score Gurantee. If anyone intrested mail me on kris.bi121@gmail.com

16 Answers  


i want to create a crosstab report where product will be on rows year on column and revenue on measure. based on the users selection in value prompt, if user select the August 15, crosstab year column should display values for aug 15, aug 14, aug 13 and aug 12 i.e for last for years but same month. how could we achieve this?

1 Answers   JPMorgan Chase,


if report performance is low how can check 3 areas in framework manager?.what are the 3 areas concentrate?

3 Answers   CTS, TCS,


Can you define metrics designer?

0 Answers  


How do I remove the hyperlink from the drill through report?

2 Answers   Misys,






What is Tool Tip? and how to create in report studio?

1 Answers   Wipro,


What are user classes?

1 Answers   HCL,


. how will we hide the “report title ” in pdf format, but title should be remain unchanged in html format.

3 Answers  


actually 2 members working in same module.at a time is possible to work on same module? i add some tables,another person also add some tables how the synchronization betn the two in same module? pls ans me and expain to me.....

0 Answers  


what is a box type in cognos? what is a stitch query? what are the services that run in background when cognos is running

2 Answers   IBM,


Whrer u can save the Report net documentation in our local system?

1 Answers  


What is a query set?

3 Answers   IBM,


Categories