Select to view content in your preferred language

Calculation works in Connect but not web app

1049
3
Jump to solution
11-01-2022 10:39 AM
AmyRoust
Frequent Contributor

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

3 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})

AmyRoust
Frequent Contributor

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.

RobertHarrison2
Emerging Contributor

I thought I just lost a week of work because this just wasn't possible in mobile web browsers but this fixed things. Thank you!