We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!

Calculated field with missing values

aarrietaaarrieta Posts: 16
We have a CRF that a central cardiologist reads an ECHO and enters three values for certain fields. We created a calculated field on that CRF to take the average of the three reads. We have found that if one of the fields is missing (for example one of the three images can't be read) the calculation does not work. Is there a way to write the calculation so it takes the average as long as at least one field is entered? This calculation is part of inclusion criteria so it must be on the CRF, we can't do the calculation after downloading the data. We had hoped to have the database do it automatically otherwise we rely on the cardiologist to do it by hand.
Post edited by bbaumann on

Best Answer


  • kristiakkristiak Posts: 1,340 ✭✭✭


    If only one field is entered, then that value is the average and you have no problem. Likewise if all three fields are entered there is no problem, I guess you can construct the CRF with two options. If all three values are available, enter on line 1 and write a calculation for this.

    If only two values are available enter them on line 2. Here you write a calculation for two values.

    If only one value is available the you do need to calculate anything. It is clumsy and maybe Gerben, Christian or someone else can come up with a better idea. I'm sure that you could resolve it with a rule where you have more options.

  • kristiakkristiak Posts: 1,340 ✭✭✭
    edited March 2014 via Email
    Wooooow! Alicia that was clever!! Regards Krister
    Post edited by [Deleted User] on
  • aarrietaaarrieta Posts: 16
    Thanks Alicia.

    Instead of using 999 would decode work if I put "." for missing? For example: decode(ITEM1,.,0,ITEM1). Or do you have to have a value?
  • agoodwinagoodwin Posts: 131 admin
    Hello Adrienne,
    I haven't tested that specifically. I am not sure if that would work. I do know that it will not work with "" e.g.( ITEM1,,0,ITEM1 ). I think it also would depend on your data type. If you get a chance to test it out could you let us know? I think it only works with numeric but would like to know your findings.

This discussion has been closed.