Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7184 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello,

I am trying to query through a table record by record to add up a certain field of the records that qualify under the if statement:

If ( qualification1 and qualification2 and qualification3; Sum ( add up certain field of all the records that made it through the if statement ) ; 0 )

However, the if statement goes through the first record only and, if it qualified, adds up all of the table's entries, regardless of whether they qualified individually.

Is there a foreach statement or something similar I can use?

Thanks.

Posted

Calulation field functions can only "see" data in their own record. They cannot see data in other records or the found set. (The GetSummary function is the only exception.)

Summary fields can see found sets. So you want to make a summary fiels that sums a calculation field.

Posted

Thanks once again Vaughan. I don't think that a summary field will work, because there are multiple sorting criteria that would go into the field. More specifically, I am trying to keep a running sum of a field, should the underlying record have a qualifying content in three other fields. Should one of these three fields be different....B)

A B C D

1 1 2 10

1 1 3 13

1 2 2 5

2 1 3 9

2 2 1 14

2 1 3 10

Trying to summarize data in column D for each unique data in column A, if data in column B = 1, and for each unique data in column C:

A C Summary

1 2 10

1 3 13

2 3 19

I have the sorting mechanism for columns A & C, but Summary is non-exclusive, so I get:

A C Summary

1 2 61

1 3 61

2 3 61 (Sum of all of column D, since the 1 record meets the criteria. E.g. it simply sums everything if the first record qualifies)

Is there anything more specific I can do?

This topic is 7184 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.