# Calculation Formula does not work

Hi everyone …

I have some problems when creating xml formula.

1. I have variables A6_SIT_SC (start time) and A7_EIT_SC (end time). The question is whether I can make a constraint if the difference between end time and start time can’t be less than 5 minutes?

2. B2_GAUSG_SC is an integer type variable (Gestational age at the 1st USG examination (week)). I want to make an answer
which automatically fills in B2_GUSGO_SC if the answer B2_GAUSG_SC <13 then in B2_GUSGO_SC will be filled in 1 (CRL) and> = 13 will be filled in 2 (FL).
B2_GAUSG_SC filled in if you have ever done an ultrasound check. if it never do ultrasound then B2_GAUSG_SC will be missed.

I previously made calculations and constraints but it didn’t work, initially it could be filled in automatically but it turned out to be an error …

1. Like question number 2 but the conditions are more complex …
F1_HI_SC is filled in “1” if C4_HOIP_SC is filled in “1” but C4_HOIP_SC will be filled in if it answers “1” in C3_HOS_SC …

what formula should it be?

1. If I have a question in decimal form (hemoglobin) D3_HB1_SC. Then in question E4_HB_SC will automatically be filled in “1” if D3_HB1_SC > = 10,

thank you
Try.xls (37.5 KB)

Dear @dy10,
just two hints:

1. At the following place your brackets are not balanced:in the constraint: (3 opening, but only 2 closing brackets)
select_one mq6xj29 … constraint:
( \${B2_GAUSG_SC} >13 and \${B2_GUSGO_SC} = 2 ) or ( not ( \${B2_GAUSG_SC} >13 and \${B2_GUSGO_SC} = 1 )

2. And as far as I know, you cannot directly mix or with and. (Only with brackets). This might be a problem here: select_one bk36i73 … constraint …

Kind regards

1 Like

Thanks wroos i found the solution

1 Like