Skip to main content
dale_parent
Helper ⭐️
Oct 17, 2018 7:47 PM UTC
Question

Handling nulls in MDA calculated fields

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

pele
Helper ⭐️⭐️⭐️
Oct 18, 2018 1:23 AM UTC
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
Translate
sai_ram
Expert ⭐️⭐️
Nov 16, 2018 7:16 AM UTC
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. 

 

 

Translate
dale_parent
Helper ⭐️
Nov 19, 2018 8:19 PM UTC
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

Translate