relevant calculated fields are returning 0.00 when there is nothing to calculate and should be NULL

866
13
08-22-2018 01:01 PM
LynnBerni
Occasional Contributor II

In the following screenshot, the fields 5 & 6 are calculated based on data in fields 1-4. The whole group (fields1-6) is relevant as to whether or not a sample is collected. But, when no sample is collected, the calculated fields are returning 0.00. I would like them to be blank. Is there a way to control (cancel) the calculation when the relevant expression is not met?

0 Kudos
13 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Lynn,

I am seeing that calculate questions are submitting their calculations when not relevant.  However, it I'm not seeing the effect when the items are in a group.  Can you share the survey or the part of the survey experiencing the issue?

0 Kudos
LynnBerni
Occasional Contributor II

Hi James,

Here's a link to the xls form. It's the "Sample Analysis" group.

Thanks!

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Lynn,

This doesn't appear to be the right survey- I'm not seeing the group you refer to.

0 Kudos
LynnBerni
Occasional Contributor II

Hi James,

That's the one, the group starts on line 19 of the sheet. 

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Thanks, I missed it in my review.  In looking through what's occurring, it appears there is a change in how null values are being handled- before, they would have prevented the pulldata() function from running.  I've filed an issue to look into this.

markcain
New Contributor II

You should be able to wrap the calculation in an if statement.

eg  

if(${no_sample}!='',calculation,'')

This basically means that if the field ${no_sample} is not empty, then the calculation is performed, otherwise the field is blank.

or if you want it to only calculate when a certain option is chosen

if(${no_sample}='option1',calculation,'')

0 Kudos
LynnBerni
Occasional Contributor II

thanks Mark, tried the if statement and the field is still being populated with 0.  This field just doesn't want to be NULL!

0 Kudos
LynnBerni
Occasional Contributor II

Hello James Tedrick,

Have there been any updates on this issue?  Or maybe other suggestions I could try? It continues to plague us.

Thanks!
Lynn

0 Kudos
SteveLynch
Esri Regular Contributor

is the table a .dbf or in a file geodatabase?

0 Kudos