Jump to content

Evaluate function and repeated field: Puzzling miscalculation


sfpx
 Share

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

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

Link to comment
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 ) )
Link to comment
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 ?

Link to comment
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:

Link to comment
Share on other sites

This topic is 2902 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
 Share

×
×
  • Create New...

Important Information

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