Survey123: selecting highest value in group and autopopulating another cell

1337
1
Jump to solution
06-26-2017 12:20 PM
Labels (1)
KaraHarmet
New Contributor III

Hello,

I have a range of numbers (each is a variable or name) in one big group (each weight is part of a group within one large group). I need to select either the last value or the maximum value from a group of variables out of this big group. Either would work. I know there is the max() function, but it does not seem to work. This is what I have in the calculation field:

max(${AggScaleReading20},${AggScaleReading19})


Either 'TypeError' shows up or more specifically: 'TypeError: Cannot call method 'forEach' of undefined in expression'

I have tried changing the type to see if that changed anything and it does not solve the issue.

I could not find any similar problems online so I am posting mine here.

Thanks,

Kara

1 Solution

Accepted Solutions
KaraHarmet
New Contributor III

I figured it out. It was partially the order I was putting the calculations in (in relation to the variables) and the other part was an issue with nested groups. At least for me, for the max() function to work the variables all had to be in a the same group if they were in a group. The max() function also had to be after all the other variables it was taking into account, which makes sense.

View solution in original post

0 Kudos
1 Reply
KaraHarmet
New Contributor III

I figured it out. It was partially the order I was putting the calculations in (in relation to the variables) and the other part was an issue with nested groups. At least for me, for the max() function to work the variables all had to be in a the same group if they were in a group. The max() function also had to be after all the other variables it was taking into account, which makes sense.

0 Kudos