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

Sum condition 1

Status
Not open for further replies.

deulyd

Programmer
Oct 17, 2001
106
CA
Hi,

I need to do a conditional sum on a numeric field but I can't find the way to do it...

I'm in a {WORKTYPE} group and I need the sum of {HOURS} field for records that {STATUS} = "CLOSED".

The folowing works, but does the sum for all the status :

sum({FOLDERS.HOURS}, {FOLDERS.STATUS})

How can I add a condition in here?

Thanks

Daniel
 
You need to use a running total field.

Summary
Field to summarize: {HOURS}
Type of summary: sum

Evaluate:
Use a formula - click on X=2 button and use the formula
{STATUS}="CLOSED"

Reset
On Change of group - {WORKTYPE}
 
Or you could create a formula:

if {folders.status} = "CLOSED" then {folders.hours}

Then right click on this formula and insert a summary (sum).
However, this assumes that you do not have duplicate data.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top