Select to view content in your preferred language

Complex Calculation may not be possible

282
1
04-20-2023 06:34 AM
EvanDarpini
New Contributor II

I need a calculation for a survey123 form. I have a decimal field called "DBH" in which multiple numbers can be entered separated by a "-", for instance: 1.2-4.6-18.3-7.2. the next field is a note called "DBH_Calculation. I need the note to calculate the square root of the sum of squares of the DBH field. using my previous example it would calculate the square root of (1.2^2+4.6^2+18.3^2+7.2^2). I think it may not be possible to perform this calculation without seperating the multiple DBHs into there own decimal field but if its possible to do this it would be great.

0 Kudos
1 Reply
Katie_Clark
MVP Regular Contributor

Is there a reason you have the users entering the DBH measurements in a single field as a string, rather than using a repeat?

In your case, you'd need to use a custom javascript function and separate the numbers using a text delimiter, then access each of those values within the resulting list and perform the calculation that way. 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek