Sum ForEach

Hello All,

I am creating a report and I need to create a variable “Sum”. The report looks like :

EmpID…Code…SCode…Revenue…Sum(Expected Result)
1…10…#…0…600
1…20…10…100…100
1…30…10…200…200
1…40…10…300…300
2…10…#…0…1200
2…20…10…400…400
2…20…10…800…800
2…30…#…0…500
2…40…30…300…300
2…40…30…200…200

Whenever “SCode” is “#”, Then “Sum” is equal to Sum(Revenue) where “SCode” is equal to “Code” available in front of “#” foreach Emp.
For Example Empid =1 and Code = 10 Then Sum = 100+200+300
For Example Empid=2 and Code = 10 then Sum = 400+800
For Example Empid=2 and Code=30 then Sum= 300+200

Please help me to create the formula for Sum…it is bit urgent…

Waiting for your reply

[Moderator Edit: Removed “urgent” from subject, please see here for details. – Dave Rathbun]


sandeep_sinha (BOB member since 2008-08-27)

You’re asking for help, but not giving an example of what’s been attempted.

Have you tried: =Sum([Revenue]) ForEach [EmpId] ?

I don’t even get what you’re not just creating a break on the EmpId, creating a Break Header and placing the aggregate (sum) there.


digpen :us: (BOB member since 2002-08-15)