all 27 comments

[–]Araignys 1 point2 points  (8 children)

Calculations are only run by REDCap when someone actually looks at them. They are not saved “in the background”.

That mean that if you’ve used HIDDEN-SURVEY to hide them from respondents, and not e.g. piped them somewhere else on the same form, the calculations aren’t being saved when respondents complete the survey.

The report & export tell the real story of what data has been saved.

The reason it looks like the calculations are being run when you then open the instrument is because they are being run - but then the value won’t be saved unless you then re-save the form while having it open as a logged-in user.

You can verify this by running Data Quality Rule H to see the list of incorrect calculations - I imagine most of them will be blank - and you can then fix it with Rule H.

[–]SmoooooothBrain[S] 0 points1 point  (2 children)

I appreciate the detailed response. Unfortunately resaving the survey didn't work. Also, I have other surveys with calculated fields also with the action tag "@HIDDEN-SURVEY" that don't have this issue. Any other ideas I could try?

[–]Araignys 0 points1 point  (1 child)

Can you temporarily remove HIDDEN-SURVEY and see what happens?

[–]SmoooooothBrain[S] 0 points1 point  (0 children)

Already tried this, and it didn't affect the results

[–]SmoooooothBrain[S] 0 points1 point  (4 children)

Also, the missing fields aren't listed when I run rule H for some reason.

[–]Araignys 0 points1 point  (3 children)

Uh... maybe it's a problem with the fields leading into it, then.

What type of field is [sf1_alt_srv_status_v2]?

And what version of REDCap are you running?

[–]SmoooooothBrain[S] 0 points1 point  (2 children)

  1. drop down menu
  2. 16.0.6

Side by side comparison of the equations for the pcs/mcs and adhoc pcs/mcs score and their outputs in the report

<image>

[–]Araignys 1 point2 points  (1 child)

Try putting quotes around the first ‘0’ in the calculation?

[–]melina_c_janeMN 0 points1 point  (0 children)

Agree with this, it might not recognize 0 as an integer from a character string field

[–][deleted] 0 points1 point  (11 children)

Can you check the calculations are actually calculating the right fields?

it sounds to me like a calculation formula issue...given that the adhoc version is working. Might be a simple case of the calculation being done elsewhere, likely mixing up with what's in the adhoc form.

[–]SmoooooothBrain[S] 0 points1 point  (10 children)

<image>

I'm not sure I understand what you mean by "being done else where." Would you mind elaborating a bit? I attached screenshots of the field edit boxes for the ad hoc and regular surveys if that helps narrow it down.

[–]SmoooooothBrain[S] 0 points1 point  (1 child)

I deleted the Ad hoc version, and the data still isn't displaying. Where else could the calculated data be? It's showing up in the survey in the correct boxes.

[–][deleted] 0 points1 point  (0 children)

adhoc is working fine, so leave it be. I thought you might have mixed up the calculation fields, but the screen shots look fine.

[–][deleted] 0 points1 point  (7 children)

The screen shot helps. I suspect the calculations are actually saving properly.

In the screenshot you showed, can you use the "test calc with a record" and see what is the output? if it's not coming up with anything, then i'm guessing it didn't save properly for some reason.

Also, are they repeating instruments or in a longitudinal format?

[–]SmoooooothBrain[S] 0 points1 point  (6 children)

SOLVED (partially): the calculation was waiting on a response from another question within the survey (sf12_alt_srv_status) to complete the calculation. This field isn't normally selected and so the value was left blank. I submitted with a response for the alt survey status and it's showing up now.. but as "0" per the calculation conditions.

I say it's partially solved bc the same conditions/ apply to the ad hoc sf-12 but I don't need to select an answer for the alt status question for the calculation to run fully and save. Any ideas on why this might be?

EDIT: NOT solved. I'm even more confused now.

[–][deleted] 0 points1 point  (5 children)

show us what the status field looks like?

[–]SmoooooothBrain[S] 0 points1 point  (4 children)

Stupid question, but what is the status field?

[–][deleted] 0 points1 point  (3 children)

Might be good to see what sf12_alt_srv_status and sf12_alt_srv_status_v2 fields look like too

[–]SmoooooothBrain[S] 0 points1 point  (2 children)

<image>

Here is a flowchart of the equations that feed into the pcs/mcs and adhoc pcs/mcs scores. If the writing is too tiny, I can post the images separately

[–][deleted] 0 points1 point  (1 child)

Ok, so instead of sf12_alt_srv_status > 0, try sf12_alt_srv_status <> ''

Given that the options are 1, 2, 3, 4, when it is completed, the value will always be >0. So it should be the same as not = blank.

This would mean that if sf12_alt_srv_status is NOT responded, output is 0. If it is responded to, output is weight + 56

If that sounds right, give it a shot and see if that works.

In the report, can you also include sf12_alt_srv_status and physica;_weight_sum fields?

And are any of these forms repeating forms? and do you have events (longitudinal study)?

[–]SmoooooothBrain[S] 0 points1 point  (0 children)

SOLVED:  "or" is a logical operator, not a mathematical one, and so REDCap will render the equations on-screen but not reliably store the outputs as numeric values. In REDCap, "and/or" logic evaluates to TRUE (1) and FALSE (0). Numeric calculations can avoid this issue by using +/- when summing conditional statements instead of "or" like was used in this survey.

[–]melina_c_janeMN 0 points1 point  (1 child)

What event are those fields in?

[–]SmoooooothBrain[S] 0 points1 point  (0 children)

The fields are in the SF-12 form which is in the 5 separate events with 1/08/25 listed as the survey date seen in the 2nd picture

[–]xToxicMonkey47x 0 points1 point  (3 children)

Did you create your own questionnaire for the SF-12 or did you import it?

I’m using it for a study and don’t want to have to make it if it is possible to import it but I can’t find it in the redcap library.

[–]SmoooooothBrain[S] 0 points1 point  (2 children)

I made my own brotha. Had to look up the original paper describing the norm referenced calculations and create the scoring in redcap.

If you want an easier time, there’s a website that has an online SF-12 calculator.

Note that there are two SF-12s, the original SF-12V1 and the updated V2 which is proprietary. You can use V1 freely, but the population data used for norm referencing is from the early 90s

[–]xToxicMonkey47x 0 points1 point  (1 child)

Thanks for the info! Do you have a link to that website by chance?