Calculation works in Connect but not web app

584
2
Jump to solution
11-01-2022 10:39 AM
AmyRoust
Occasional Contributor III

Looks like others have had similar issues to this, but I'm not finding a solution to my version yet.

I have two notes fields that are doing simple calculations based on values from other fields. Here is a sample:

${Ravg_after}*${Kavg_after}*${LSavg_after}*${Cavg_after}*${Pavg_after}

 

In the Connect desktop application, it calculates as expected:

AmyRoust_0-1667324198016.png

 

When I try it in a web browser, I get NaN:

AmyRoust_1-1667324228837.png

 

I tried adding a round function since it had so many decimal points, but no luck.

What am I missing?

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Usually this is one of those values is blank or null.  Web is more picky about that.  Is that possible in your form?  If so use this around each of the values above.

coalesce(value1, value2)

Returns the first nonempty value. Supports only two values.

coalesce(${question_one}, ${question_two})

View solution in original post

0 Kudos
2 Replies
DougBrowning
MVP Esteemed Contributor

Usually this is one of those values is blank or null.  Web is more picky about that.  Is that possible in your form?  If so use this around each of the values above.

coalesce(value1, value2)

Returns the first nonempty value. Supports only two values.

coalesce(${question_one}, ${question_two})

0 Kudos
AmyRoust
Occasional Contributor III

Thank you - this is the clue that I needed. I was getting a null value in both formulas without realizing it. Once I fixed the bad reference to another field, it worked.