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

Repitition Field Calculation 1

Status
Not open for further replies.

gbenezra

IS-IT--Management
Dec 30, 2000
13
CA
Hello,

I have a numbered field which is repeating 5 times and would like to know how to get a total of only the numbers within these fields.

Thank You
GB
 
You didn't mention how the numbers got there but I'll assume that they are in the repeating field.

Use the GetRepetition ( repeating field , number ) function.

In your calculation result field you would enter this for your calculation:

GetRepetition ( your field name , 1 )+
GetRepetition ( your field name , 2 )+
GetRepetition ( your field name , 3 )+
GetRepetition ( your field name , 4 )+
GetRepetition ( your field name , 5 )

This says go to the repeating field and give me the results from field number 1 and + add it to the results from field number 2 and so on.

You could also put in a Case statement if your perameter required it.

Case(Field 1 = "Yes", GetRepetition ( your field name , 1 ),0)+
Case(Field 1 = "Yes", GetRepetition ( your field name , 2 ),0)+
Case(Field 1 = "Yes", GetRepetition ( your field name , 3 ),0)+
Case(Field 1 = "Yes", GetRepetition ( your field name , 4 ),0)+
Case(Field 1 = "Yes", GetRepetition ( your field name , 5 ),0)

Field one could be a Check Mark asking whether or not it should be included in the total.

I hope this helps!

Marty

Please mark helpful response if this is so.
 
I just re-read your scenario and thought of another possibility. You mentioned the total of only the numbers which led me to the possibility that some may contain something besides numbers. If this is the case you solution could be this:

Case(GetRepetition( your field name , 1 ) > 0,GetRepetition( number , 1 ),0) +
Case(GetRepetition( your field name , 2 ) > 0,GetRepetition( number , 2 ),0) +
Case(GetRepetition( your field name , 3 ) > 0,GetRepetition( number , 3 ),0) +
Case(GetRepetition( your field name , 4 ) > 0,GetRepetition( number , 4 ),0) +
Case(GetRepetition( your field name , 5 ) > 0,GetRepetition( number , 5 ),0)

In this we are asking is the value of the repeating field greater than 0 or zero, if so then add to our total. In a case where this field contains a text value, this would equal zero based on the above formula.

I hope this covers it.

Marty
 
Sorry for the confusion, in my last post I noticed I didn't edit a couple of field names. The field "number" should be the same as your field name.

Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top