Question

Handling nulls in MDA calculated fields

  • 17 October 2018
  • 3 replies
  • 70 views

I have a use case to treat nulls as zero on a calculated field in MDA.  It's simply A-B=C and in 25% of cases B is null.  In those cases I would like to end up with C=A but there doesn't seem to be an option to treat null as zero in MDA calculated fields.  Is this feature on a roadmap by any chance?

It's also worth mentioning in this data set the nulls in B need to stay null for downstream logic.

3 replies

Badge +3
Hi Dale, 



Pretty sure you can get to this by using the Advanced Formula option for your calculated field. I think something like the following should work:



case when B is null then A else A-B end



Hope this helps!



Cheers,

Pele
Userlevel 7
Badge +1
Hi Dale,



 



Could you please use the default value option. It can be done while creating the field or we can edit the field and add the default value. 



 



 


Hi Sai Ram,



While the default value option is a great solve for some cases I can't use it in this case. The null value indicates a unique condition we use to trigger a specific customer communication workflow, while a zero value indicates a reporting error in need of attention internally. The advanced formula does what we need for these conditions.



Thanks to both of you for your helpful suggestions


Reply