Re: SQL - Calculate 100%

  • From: Eriovaldo Andrietta <ecandrietta@xxxxxxxxx>
  • To: Adam Musch <ahmusch@xxxxxxxxx>
  • Date: Thu, 25 Nov 2010 21:18:18 -0200

Great Adam,

 It solved part of my issue.
 The ratio_to_report helped when I have this situation:

   10,90
     3,70
    85,39
  (only one column)

 but I also have the situation

  col1         col2       col3
   --------      --------     --------
  10,90      3,70       85,39 --> the sum must be 100%
   (three different columns)

Any other clue ?

I am trying to use DECODE , but the code will not be clear.

Best Regards
Eriovaldo

On Thu, Nov 25, 2010 at 3:08 PM, Adam Musch <ahmusch@xxxxxxxxx> wrote:

> The RATIO_TO_REPORT analytic function appears to be what you're looking
> for.
>
>
> On Thu, Nov 25, 2010 at 3:57 AM, Eriovaldo Andrietta <
> ecandrietta@xxxxxxxxx> wrote:
>
>> Hi friends,
>>
>>  I have the following situation:
>>
>> Value1                     Value2        Value2 / Value1 = Percent
>>
>>   4128,00 450,00 10,90  4128,00 153,00 3,70  s4128,00 3525,00 85,39
>> Sum Percent ------------------->                    99,99
>>
>> The sum of percent is not 100% ...
>>
>>   Is there any SQL instruction that does this calculation and adjust the
>> value to 100% ?
>>
>> Regards
>>  Eriovaldo
>>
>
>
>
> --
> Adam Musch
> ahmusch@xxxxxxxxx
>

Other related posts: