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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group formula problem

Status
Not open for further replies.

xanra

IS-IT--Management
Jan 16, 2007
20
US
Hi I'm having a problem with the sum of values for the details section in the group footer section.

I have 2 tables one is member information(tblmemberfinance) the other is where registration information is kept (tblartransitem). The tblartransitem table has a Foreign Key for the member info.

I'm displaying all the registrations for members for a certain date range (my parameters grouped by member.

The fields that are displayed are member name, class
registered, price, dates, balance member owes.

I need to display a value in the Group Footer Section by member what the balance is based of an equation.

Psuedocode below ---
If the currentbalance is >= sum(all the enrolled classes prices/2) then display sum(all the class prices/2)
otherwise
display currentbalance.




Here is the formula that i'm using but it isnt working.
@balanceDue

if {tblmemberfinance.balancecurrent} >= (Sum ({tblartransitem.price}))/(2)
then Sum ({tblartransitem.price})

else

{tblmemberfinance.balancecurrent}


The value that is output for my field is the total of all the classes for all the members that are displayed / 2
instead of a per member basis in the group foother section.

Thanks in advance!




 
Oh btw i'm using Crystal Reports that comes bundled with VS2005 Pro.
 
You need to accumulate tblartransitem.price for each member, i.e. a summary total at member-group level. Then compare this to tblmemberfinance.balancecurrent - does this vary?

You've got the wrong summary total. You could code it, but it is simpler to create the summary, use it in a formula field and then remove from the report if you don't want it.

If you're not already familiar with Crystal totals, the basics are explained at FAQ767-6524.

PS. I see you've trie to give your Crystal version. But most of us won't know which version comes bundled with VS2005 Pro. If your set-up allows, click on HELP and get the version from About Crystal Reports. No need for the full number, just 8, 8.5, 9, 10, 11 or whatever.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I think you need to add a group condition, as in:

if {tblmemberfinance.balancecurrent} >= Sum ({tblartransitem.price},{table.member})/2
then
Sum ({tblartransitem.price},{table.member})else
{tblmemberfinance.balancecurrent}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top