COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Virgin on 08 Apr 2015 04:20:10 AM

Title: Average of Percentage
Post by: Virgin on 08 Apr 2015 04:20:10 AM
Hello everybody,

I need your help please, i have a report with crosstab, in this Crosstab I have:

Saler         Business Product A (€)              Business for all product (€)   % (Business Product A/ Business for all product (€))

A                  10000                                           100000                                10%
B                  15000                                           120000                                12.5%

Total             25000                                           220000                                11.36%       

I want when the percentage for a saler (saler A with 10% for my example) is lower than the percentage for Total (11.36% in my example), this percentage have a background in red.

I tried with conditionnal management  but it doesn't run.

Thanks for your help.

                   
Title: Re: Average of Percentage
Post by: MFGF on 08 Apr 2015 04:27:36 AM
Quote from: Virgin on 08 Apr 2015 04:20:10 AM
Hello everybody,

I need your help please, i have a report with crosstab, in this Crosstab I have:

Saler         Business Product A (€)              Business for all product (€)   % (Business Product A/ Business for all product (€))

A                  10000                                           100000                                10%
B                  15000                                           120000                                12.5%

Total             25000                                           220000                                11.36%       

I want when the percentage for a saler (saler A with 10% for my example) is lower than the percentage for Total (11.36% in my example), this percentage have a background in red.

I tried with conditionnal management  but it doesn't run.

Thanks for your help.

                   

Hi,

Are you using a relational or a dimensional package? What do you mean by I tried with conditionnal management - can you explain what you tried? What does but it doesn't run mean? Do you get an error? Do you get nothing? Do you get colours but in the wrong places? Something else?

MF.
Title: Re: Average of Percentage
Post by: Virgin on 08 Apr 2015 04:35:31 AM
thanks you for your answer, i have a relationnal package, conditionnal rules : [Requête1].[%/N C.A. SIH] < [Requête1].[avg]  and I choose the colour of background in red. the result : nothing cells have the backgroung in red.

Title: Re: Average of Percentage
Post by: MFGF on 08 Apr 2015 04:55:03 AM
Quote from: Virgin on 08 Apr 2015 04:35:31 AM
thanks you for your answer, i have a relationnal package, conditionnal rules : [Requête1].[%/N C.A. SIH] < [Requête1].[avg]  and I choose the colour of background in red. the result : nothing cells have the backgroung in red.

What is the expression used to derive [Requête1].[avg]?

MF.
Title: Re: Average of Percentage
Post by: Virgin on 08 Apr 2015 04:57:53 AM
The expression of avg is : if([Année] = ?P_Année?) then ([Total(C.A. Isolhis et URC 2015)]/[Total(C.A. SIH 2015)]) else (0).

The agregation's function is a average and agregation's function for amount is automatic.

Thanks for your answer,
Title: Re: Average of Percentage
Post by: MFGF on 08 Apr 2015 05:11:09 AM
Quote from: Virgin on 08 Apr 2015 04:57:53 AM
The expression of avg is : if([Année] = ?P_Année?) then ([Total(C.A. Isolhis et URC 2015)]/[Total(C.A. SIH 2015)]) else (0).

The agregation's function is a average and agregation's function for amount is automatic.

Thanks for your answer,

Ok - and what are the expressions for [Total(C.A. Isolhis et URC 2015)] and [Total(C.A. SIH 2015)]?

MF.
Title: Re: Average of Percentage
Post by: Virgin on 08 Apr 2015 05:20:15 AM
it's the total of the column, there is no expression, it's summary.
Title: Re: Average of Percentage
Post by: Lynn on 08 Apr 2015 07:35:29 AM
I would try replacing the expression for [Requête1].[avg] to use total expressions with a "for" clause to explicitly define your average calculation. Set the aggregation property to none because you've already told it what to do. This would compute the exact same value for every row in your result set and should, therefore, compare as expected with the individual values that are the basis for your conditional rule.



if([Année] = ?P_Année?)
  then (
          total ( [whatever] for report )
           /
          total ( [something else] for report )
         )
  else (0)
Title: Re: Average of Percentage
Post by: Virgin on 08 Apr 2015 08:03:15 AM
it's ok but i have 2 roxs with the same data instead of 1 row. Have you an other idea please?
Title: Re: Average of Percentage
Post by: Lynn on 08 Apr 2015 08:19:48 AM
Quote from: Virgin on 08 Apr 2015 08:03:15 AM
it's ok but i have 2 roxs with the same data instead of 1 row. Have you an other idea please?

I'm not sure I understand. I was expecting that you would see something like the below in your tabular data. The .1136 is the computed figure that you want to compare to each product percentage as the basis for conditional highlighting. If that is the case then your [Requête1].[%/N C.A. SIH] < [Requête1].[avg] expression for the conditional style should color the first row red and leave the second row without any highlighting.

Is there something else we need to know to help you solve the problem?


A                  10000                  100000                 .100     .1136
B                  15000                  120000                 .125     .1136
Title: Re: Average of Percentage
Post by: Virgin on 08 Apr 2015 08:35:00 AM
it's exactly this, but when i apply your solution, the color are good but i have this:

192 780          509 870                     37,81 % 
     0                     0                           blank
152 736           720 959                    21,19 % 
     0                      0                            blank

I use the function for delete the 0 but they are still here.

Thanks