Jump to content
Sign in to follow this  
sfpx

Evaluate function and repeated field: Puzzling miscalculation

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 ) )

Share this post


Link to post
Share on other sites

 

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 ?

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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