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 do you mean by query studio?

0 Answers  


What are the advantages of cognos?

0 Answers  


what are the enhancements in cognos reportnet ?

9 Answers   IBM, TCS,


What is Online View?

0 Answers   IBM,


How much time it will take to develop a report in real time? It depends upon the complexity of the report, so tell me the approximate time period for a simple list, cascading, master-detail, drill-through,..…etc?

3 Answers  






Define query studio?

0 Answers  


How can reports be bursted based on two groups? I want to schedule to burst a report based on product line and years and I need the burst report for every product line and every year. How can this be done? Please help..

0 Answers  


What is the model filter?

0 Answers  


how many notations are posible(cordinolity)are there in between two tables(one is fact and another is dimension)pls give me a example pls.

0 Answers  


hi, I want to create this report... List View--- -(Drop down list) Order Date From: \/ To: Customer Employee Order customer ------------------------------------------------------------ ------------------------------------------------------------ ------ customer c-name c-address c-phone c- city.................... ------------------------------------------------------------ ------------------------------------------------------------ ----- c-id c-type . . . ------------------------------------------------------------ ------------------------------------------------------------ ---- Employee .............same like one list Order.....................same like one list These are all in one page....i want u show... condtions *when i select in view type ex:employee and date as 10-05- 2007 to 10-05-2010 I need to go the employee list table and display the items .. And Iam trying in value prompt for creating of (cust,emp,ord)in a single value prompt,that will not created... and how to create 3-list and connection for those in value prompt.. Pls any one knows explain me (by step by step) of creating that report? Thanks Vannur

0 Answers  


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

5 Answers   CTS, IBM,


When You Import data into catalog You have complex columns names. How do you change the Name of those columns?

2 Answers  


Categories