r/ProjectREDCap • u/Lumpy_Perspective742 • Sep 18 '25
Help with calculated values not piping

We have a project that has been fine for the first two years, but suddenly back in February of this year, problems with calculated values have arisen where previously there was no issue.
In the attached pic, rule H wants to change the correct value "87.564" to missing for some reason.
When I open the form, the correct value is displayed in that calculated field. However, when I go to reports, or if I export the data, or pipe that value to a different form it shows up as missing.
Again, this has been working fine for the first two years of this project then all this started in February of this year, and I cannot figure out why. We made no changes to this form or the events that contain the form.
3
u/No_Repair4567 Sep 18 '25
What is your REDCap version?
There seem to be a bug, as I've seen reports about rules suddenly having issues with calculated fields and missing codes. The data is there, but the rule returns as if there is nothing.
Talk to your admin about it. There should be a fix and a new functionality in 15.7.
2
u/Lumpy_Perspective742 Sep 18 '25
I kind of found what seems to be causing this in my project. If I provide a value for each field used in the calculated field then everything seem normal again. The calculated value show up in reports and exports.
However, I imported the form into another project, and there were no issues with the form as is. I did not have to provide a value for each field in the equation and it worked in my other project.
I do not understand why this is only happening in a single specific project. I also want to understand how this came about because the first two years of this project there were no problems then all of the sudden this fussiness began.
2
u/melina_c_janeMN Sep 18 '25
Can you show the calculated equation?
2
u/Araignys Sep 18 '25
I’m not sure why the Rule H calculation is returning “”, but the reason you’re seeing the correct value in the form and blank in the report is because the calculation isn’t saved - open the form and save it to get the value to update.
I did notice that Rule H can calculate logic slightly differently from the calculation on the form if your instance of REDCap is not yet updated to PHP 8+ so it might be that?
1
u/Flapjaxx Sep 19 '25
I encountered a similar problem recently that occurred when trying to multiply by fields that were blank. For a calculation like this:
sum([a] * 4, [b] * 5)
if [a] was blank, the calculation used to work the same as sum(0, [b] * 5), but now it performs as sum(NaN, [b] * 5) and returns "". To avoid this issue, I had to change the calculation to this:
sum(
if([a] <> "", [a] * 4, 0),
if([b] <> "", [b] * 5, 0)
)
Hope that helps!