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 |
Can you define cognos decision stream?
-----------------What is Determination Model?
Can we create a report in cognos BI without a Package? i.e. without framework manager? If so how? I have been asked this question twice..i think this feature is available in cognos 10 version..not very sure....Could anybody highlight?
Can anyone explain the procedure for configuring cognos8 with oracle as Content Manager/Content Store? I know the configuration of cognos8 with SQL SERVER (Like how to create CM database in oracle and applying securities to access that Database from cognos8 (Cognos Configuration)
Which one is better among Value and select & search prompts,in terms of performance?
How can we give the same color for alternate(1,3,5.... and 2,4,8...) cells in a column?
hi..i'm searching on cognos.i want to know some real time explanation..persons who have real time exp and who r searching in this field..can u send ur mail-id..my mail-id is dhaanuus@gmail.com..hope u will respond as soon as possible..
What is the concept of using Dimension allocation "By Measure"? How Transformer use when computing the Base measue?
----------------What is Scopr Relationship?
Hi all, i have a requirement in Conditional drill through. I have a list report with Cities India, UK, USA, China, japan, Canada.... In the above cities i want to give Hyperlinks(Drill) for Only India & UK. Could you please send me the steps????
hi Cognos Experts Pls Expalin me what is the diffence between list report query and crosstab report query?pls explain me.....
What are the types of catalogs in cognos?