Calculated variables (fx)

Dear team, along with saying hello, I am writing to tell you that we have had some problems with calculated variables (fx) this is created with the following expression “@rowcode==mh02?1:mh04”, and the variable is inside a flat roster display which is visible according to the flow of the survey. “!(@rowcode==mh02)” previously the variable was calculated without any inconvenience passing through the flow in version 21.06 now with the updated version of the server 22.02.5 the calculation of this variable is not executed if the roster is not visible where this variable is added.

Is this a new way of working or is it an error in the application? It is worth mentioning that only the server was updated and not the version of the questionnaire

Thank , Felipe J (INE Chile)

Hello Felipe and thank you for the question.

Calculated variables don’t have own enabling conditions, but may be part of a group (section, sub-section, or roster) which has an enabling condition.

Calculated variables are only calculated if the variable is not part of a disabled group. The exported data will contain a missing value if a variable was never calculated or if it was calculated but then the group that contains it became disabled.

Whether a roster item is shown or not also depends on the enabling condition. So if you are not seeing a roster item, don’t expect calculated variables from that line of the table.

You wrote:

…with the updated version of the server 22.02.5 the calculation of this variable is not executed if the roster is not visible where this variable is added.

If anything it looks like some bug was fixed which caused the variable to be calculated when it shouldn’t be.

You may want to reveal the actual or a minimal example where the issue is observed. (For the minimal example it is probably sufficient to have a fixed roster with some condition based on the @rowcode and a variable in the roster, but you will need at least one question to make the questionnaire valid). Looking at that questionnaire it should be straightforward to determine whether the variable should be expected to have a value in the export or not.

Best, Sergiy

Thanks Sergiy, it is exactly the current behavior of variables with version 22.02.xx. our problem is that in the past version 21.06 this did not happen like that, and now our form in operation encounters problems.

Is there a way that these variables are activated or calculated when they are in a hidden section without intervening in the design of the questionnaire?

saludos, Felipe J.

Hello @Felipe_Jimenez ,

the described behavior was intended from the inception of the calculated variables. I am not aware of specific complaints in between the two recent releases that may have affected the eligibility of variable for calculation/recalculation or export. Thus, I humbly question the accuracy of your measurements/conclusions regarding the behavior of the older version:

What was the exact questionnaire structure with which it was observed? Was there anything else that could have affected this? Specifics would be helpful here.

Our public demo server has been pushed to 22.02 version. But if you still have a copy of the 21.09.* running somewhere we can experiment to see what can be happening there.

No. There is only a single mode of operation regarding calculation of variables. There are no options or parameters that regulate it on the user situation.

Best, Sergiy

If there is a problem sharing the questionnaire and/or constructing the example, it would be at least useful to know if the variable is used in text substitution for the custom roster title. But of course, the more information, the better.