-
gradelinkAsked on November 16, 2017 at 2:41 PM
I am messing around with some conditional calculation and discovered that I could insert functions. I am interested in using the "nth()" function, but I'm not sure exactly how to call it.
For example, would I just write nth(item1, item2, item3, item4, item5)? I feel like this is wrong because I'm not defining what the "n" value would be.
However, if I include the "n" do I need to enclose the items I'm sorting in parantheses i.e. nth(3, (item1, item2, item3, item4, item5))?
-
aubreybourkeReplied on November 16, 2017 at 3:37 PM
The nth expression evaluates which of the supplied parameters is the highest.
Here's a demo:
https://form.jotform.com/73195797428978
It uses a form calculation widget. And is configured like so:
Hope that helps!
-
gradelinkReplied on November 16, 2017 at 3:50 PM
That answers some questions, but creates more: if nth() merely returns the highest value in a set, how is it different from max()?
-
aubreybourkeReplied on November 16, 2017 at 4:06 PM
The nth() function can also specify an additional parameter. This will be 1 for the first biggest number, 2 for the second biggest number, etc
While the max() function just returns the biggest number.
-
gradelinkReplied on November 16, 2017 at 4:15 PM
That reference sheet will work perfectly, thank you. I was confused about the appropriate syntax.