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!

Formula for summing a sum by group and adding percentage calculation

Status
Not open for further replies.

jlr123

Technical User
Feb 24, 2014
117
US
Need formula for: If group name = "abc" and "def" and "ghi" then sum (sum of extended amt)and multiply by 1%.
thanks!
 
if GroupName({your_group_field}) in ["abc","def","ghi"] then Sum({your_number_field},{your_group_field}) * 1.001
 
if GroupName({your_group_field}) in ["abc","def","ghi"] then Sum({your_number_field},{your_group_field}) * 1.001
 

if GroupName({your_group_field}) in ["abc","def","ghi"] then Sum({your_number_field},{your_group_field}) * 1.01
 


That's actually multiplying by [highlight #FCAF3E]101%[/highlight] rather than [highlight #FCE94F]1%[/highlight].

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Well that's most certainly not what was stated in the OP.

Perhaps that was the intent based on the TITLE, which is not part of the actual post.

But my crystal ball needs a cleaning.

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Here is my forumula ( percentage is 1.25%): However, it is not calculating correctly. At the THEN statement, I am wondering if this is correct because I have a total calculation in my report which is Sum of AR_InvoiceHistoryDetail.Extension Amt.

If GroupName({AR_InvoiceHistoryDetail.UDF_CC_CODE})in
["ONS","RENT","SVC"] THEN Sum({AR_InvoiceHistoryDetail.ExtensionAmt},{AR_InvoiceHistoryDetail.UDF_CC_CODE})*.0125

My report fields:
CCCode Group #2Name @CC Total Label Sum of AR InvoiceHistoryDetail.ExtensionAmt
 

However, it is not calculating correctly

1. What are the distinct values of the ExtensionAmounts for each group in question?

2. What result are you expecting for the SUM of that partition * .0125?

Please post an answer to each of these questions.

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Is this formula in the Detail, or in the Group Footer? It could be multiplying the sum by the percentage for each record, which would definitely give the wrong result.

Also, there is no ELSE - what do you want for the other groups? My guess would be that you want the sum not multiplied by the percent, but you're not telling it to do that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top