Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Evaluate function and repeated field: Puzzling miscalculation

Featured Replies

Evaluate.png

 

Note that this is just an example that does not make sense. It's just to illustrate my problem.
 
Field "A" is
Let ([c=Conditions];
Case 
( 
Evaluate(GetValue(c;1))=1; List(GetValue(c;2);GetValue(c;3));
Evaluate(GetValue(c;4))=1; List(GetValue(c;5);GetValue(c;6));
Evaluate(GetValue(c;7))=1; List(GetValue(c;8);GetValue(c;9));

""

) //fin case

)

It's pretty ugly and the project's real implementation uses a custom function but the result is the same.

 

Field "Conditions" is a plain text field which contains conditions to be evaluated by the field "A". Each condition has 3 lines (the condition and 2 other numbers). When a condition is true then Field "A" retrieves the 2 numbers after the condition line.

 

Field "Test" is a repeated calculation (2 repetitions)

GetValue(A;Get ( CalculationRepetitionNumber))

As you can see in the picture above, the 2nd repetition does not work.

 

Strange thing is that it works if I get the conditions via a SQL query

ExecuteSQL("select Conditions from ETEST
where 
AID=1";
"¶";"")

A2 is the same as A but it evaluates conditions2 field

Test2 is getting the values of A2

 

As you can see in the picture above, both conditions fields have the exact same data and the A2 and A fields are also identical but test2 and test don't produce the same results.
 
I have attached the example file .
 
I must be missing something fairly simple ...
 

evaluate.fmp12.zip

Field "Test" is a repeated calculation (2 repetitions)
GetValue(A;Get ( CalculationRepetitionNumber))

As you can see in the picture above, the 2nd repetition does not work.

 

I believe that needs to be =

GetValue ( Extend ( A ) ; Get ( CalculationRepetitionNumber ) )
  • Author

 

I believe that needs to be =

GetValue ( Extend ( A ) ; Get ( CalculationRepetitionNumber ) )

 

Looks like you are right ! Thanks .

 

Any idea why Test2 works without the Extend function ?

Sorry, I didn't get so far.

  • Author

Sorry, I didn't get so far.

 

No big deal, I was just wondering because it's a bit strange that a repeated calculation works without the extend function in the particular case of that Test2 field.

 

The only difference between the 2 repeated fields is that the first one refers to a text field and the other one to a calculated text field.

 

If someone knows I would like to understand  :logik:

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.