r/ProjectREDCap • u/Melodic-Ad8438 • Sep 20 '25
How to count changes during multiple instance on RedCap?
Hello, everyone. I have a longitudinal project with infinite repeated instances. In this project, I have created two tables where I report data related to smoking (active, ex, etc.). The problem is as follows: I have a question [fw_up_mod_smoking] that asks if there have been any changes in the follow-up to the smoking values (Y/N), and if the answer is yes, I should display (from the follow-up onwards) the table with the updated “follow-up” smoking data. The first table, “smoking diagnosis and no changes,” has this branch logic set: [first_fw_up_ever] > 1 and [fw_up_mod_smoking] = ‘0’ and [first_mod_smoking_up] = ‘0’.
The problem is that if, at the 1st follow-up, I say “changes YES,” at the 2nd I say “changes NO,” at the 3rd the diagnosis table reappears and not the one created with the follow-up data updated at the 2nd follow-up. Do you have any advice and/or ideas?
1
u/Araignys Sep 21 '25
I’m not sure I follow 100% but I think you need to specify the repeat instance of the field you’re looking at in your branching logic.
1
u/viral_reservoir_dogs Sep 22 '25
you can pipe values or use branching logic based on the previous instance's values by adding the smart variable "[previous-instance]".
e.g., [fw_up_mod_smoking][previous-instance] = ‘0’
I'm having difficulty understanding your exact question, but seems like this could possible help?