Without storing sum in variable can I get percentage in group footer?

State : NY
Region 1
Total Referred: 100 (Expression : MyTable.RefferedField)
Became clients: 27 (Expression : MyTable.ClientField)
% : 27 (Expression : (
MyTable.ClientField*100)/MyTable.RefferedField)

Region 2
Total Referred: 60
Became clients: 12
% : 20

Region 3
Total Referred: 87
Became clients: 32
% : 37

NY StateWide
Total Referred: 247 (Expression : MyTable.RefferedField
Calculation type:Sum Reset based on: Group:State)
Became clients: 71 (Expression : MyTable.ClientField
Calculation type:Sum Reset based on: Group:State
% : 29 <--- How do I get this number?

Any suggestion would be helpful. Thanks.

Re: How do I get percentage in group footer? by Anders

Anders
Tue Oct 02 14:53:18 PDT 2007

Before running the report :
SELECT region, SUM(client*100/reffered) AS percent FROM Mytable GROUP BY
REGION ;
INTO CURSOR Q1
SELECT state, SUM(reffered) AS reffered , SUM(client) AS client,
SUM(client*100/reffered) as percent ;
FROM Mytable GROUP BY state WHERE state ='NY';
INTO CURSOR Q2
In the reportfield you put:
LOOKUP(Q1.percent, Mytable.region, Q1.region)
in the group footer three LOOKUP() calls against Q2.

-Anders


"Sunny" <just4group@hotmail.com> wrote in message
news:%23jK9NnTBIHA.912@TK2MSFTNGP05.phx.gbl...
> Without storing sum in variable can I get percentage in group footer?
>
> State : NY
> Region 1
> Total Referred: 100 (Expression : MyTable.RefferedField)
> Became clients: 27 (Expression : MyTable.ClientField)
> % : 27 (Expression : (
> MyTable.ClientField*100)/MyTable.RefferedField)
>
> Region 2
> Total Referred: 60
> Became clients: 12
> % : 20
>
> Region 3
> Total Referred: 87
> Became clients: 32
> % : 37
>
> NY StateWide
> Total Referred: 247 (Expression : MyTable.RefferedField
> Calculation type:Sum Reset based on: Group:State)
> Became clients: 71 (Expression : MyTable.ClientField
> Calculation type:Sum Reset based on: Group:State
> % : 29 <--- How do I get this number?
>
> Any suggestion would be helpful. Thanks.
>
>
>




Re: How do I get percentage in group footer? by Cathy

Cathy
Wed Oct 03 04:44:21 PDT 2007

You have to use a report variable or prepare the values before running the
report.


"Sunny" <just4group@hotmail.com> wrote in message
news:%23jK9NnTBIHA.912@TK2MSFTNGP05.phx.gbl...
> Without storing sum in variable can I get percentage in group footer?
>
> State : NY
> Region 1
> Total Referred: 100 (Expression : MyTable.RefferedField)
> Became clients: 27 (Expression : MyTable.ClientField)
> % : 27 (Expression : (
> MyTable.ClientField*100)/MyTable.RefferedField)
>
> Region 2
> Total Referred: 60
> Became clients: 12
> % : 20
>
> Region 3
> Total Referred: 87
> Became clients: 32
> % : 37
>
> NY StateWide
> Total Referred: 247 (Expression : MyTable.RefferedField
> Calculation type:Sum Reset based on: Group:State)
> Became clients: 71 (Expression : MyTable.ClientField
> Calculation type:Sum Reset based on: Group:State
> % : 29 <--- How do I get this number?
>
> Any suggestion would be helpful. Thanks.
>
>
>