Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group total value to divide with each row in the group 1

Status
Not open for further replies.

northw

MIS
Nov 12, 2010
140
US
Hello all,
I have an issue with group total value, I am using hierarchical grouping in my report, where the orders have "rejected" and "accepted", every group has only one "rejected", For that I have to take the amount associated with the "rejected" value and divide it amount associated with accepted.

1 100 acc (100/50(rej amount))
1 200 acc (200/50)
1 100 acc (100/50)
1 50 rej (50/50) (It can be 0 for a few groups)
1 0 acc (0/50)
1 200 acc (200/50)
2
2..etc...

Thanks in advance

 
You're going to have to use some formulas....

Since you don't list the fields names, I'll make some assumptions for the examples....For the amount rejected, you'll need two formulas that look something like this:

1. I'll call this one {@IsRejected}
If {table.status} = 'rej' then {table.amount} else 0

2. {@RejectedTotal}
sum({@IsRejected}, {table.group_field})

Now, for the division - you'll need a formula that looks something like this:

3. {@Division}
If {@RejectedTotal} > 0 then
{table.amount}/{@RejectedTotal}
else 0

You need to check for 0 amounts because division by 0 throws an error.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Thanks Dell, I have tried another approach, I added command object bringing in only rejected and doing the required in the report.

Thanks again Dell!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top