I am testing out Survey and I was wondering if the following would be possible to pass an argument to a formula entered in the "Caculates" sheet. Let's consider the following use:
- I am using the Calculate sheet, say to calculate an age from a birthday entered by the user. I would use the data entered by the user in a formula to calculate the age, like so:
calculation: (now().getTime()-new Date(data('birthday')).getTime())/1000/60/60/24/365
I then have an "assign" type prompt in survey sheet (say, "member1_age") that has calculates.calculateAge() for a value in the "Calculation" column of the survey sheet.
Now if I have 4 family members, instead of having 4 formula to enter (with something like (data('member1_birthday')) & (data('member2_birthday')) & etc), it would be nice if I could just pass to my calculation the variable on which I would like to it base its calculation. So it would look like this:
calculation: (now().getTime()-new Date(data(variable_passed_as_argument)).getTime())/1000/60/60/24/365
And in the survey sheet, in the Calculation column, something like:
calculates.calculateAge(member1_age) for member1
calculates.calculateAge(memeber2_age) for member2,
Would there be a way to make this work? If possible, how to I make my calculation understand I don't want him to use the argument?