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

Sum If Statement?

Status
Not open for further replies.

LauraW

IS-IT--Management
Mar 7, 2016
22
US
I have a report that I need to group information by pay codes and sum the information as a total. For example: Employee X works all 4 quarters of 2015. He has OT hours in each quarter with a pay amount associated with it.

I can't seem to get it to work. What am I doing wrong?

if {QUARTWAGE.PAY_SUM_GRP} IN ["OV1", "OV2", "OV3", "OV4", "RSC", "S08", "S09", "S10", "S11", "ST1", "ST2", "ST3", "STF", "STP"] then
sum ({QUARTWAGE.WAGE_AMOUNT})
 
Ok - I think I figured it out. I have to create a group and then do a sum via a running total. I would have thought there would have been an easier way!
 
You might have been able to make a conditional running total. Have a condition on the running total to only evaluate on the above criteria.
 
Or this way.

Amend your formula to this:

[Code {@Conditional_Amt}]
IF {QUARTWAGE.PAY_SUM_GRP} IN ["OV1", "OV2", "OV3", "OV4", "RSC", "S08", "S09", "S10", "S11", "ST1", "ST2", "ST3", "STF", "STP"]
THEN {QUARTWAGE.WAGE_AMOUNT}
[/Code]

You can then add a summary of the {@Conditional_Amt} formula.

Hope this helps.

Cheers
Pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top