Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

add dropdown menu response to constructed list

I have one grid-type question (Q1) in which respondents have two dropdown response options with:
* List1: the hours they spend on an activitiy (1-600)
* List2: the minutes they spend on an activitiy (1-60)

Now i would like to make a constructed list in which I combine the answers on the two dropdown responses (List1 & List2). The steps i have to take:
1) express the minutes dropdown answer (List2) in hours by dividing it to 60. So for example: if the respondent gives 15 minutes as an answer, it is 15/60 = 0,25 hour
2) sum the hours (List1) and the minutes (List2). So if the respondent gives 2 hours and 15 minutes as an answer, the sum is 2,25 hours.
3) make 1 constructed list with all the answer options. So i would like to have 1 constructed list with the answers on List1 & List2 combined.

How can i do this? Since there are a lot of response option, 600 at List 1  & 60 in List2, i can not do this mannually. I hope someone could share a simple code with me to achieve this.

Thanks in advance!
asked Mar 24 by Jeroen
Do you need this as a constructed list?  What do you plan on doing with this list?

If you do need it, a spreadsheet program like Excel might help speed up the process.  If the first column represents hour values and the second represents minutes, an Excel formula could produce the combined values in the third column.  Then a copy-and-paste can move these values into a Lighthouse Studio list.
Yes, i need a constructed list because i have to make calculations based on the amount of hours and minutes  in another question in the survey.

Specifically, i am asking if the respondent is willing to pay an amount of [amount of hours * price per hour] for a certain service. So i have to use the response given in the previous questions to make this calculation.
But why does that have to be a constructed list?  With a pass-in field and some unverified Perl, we could just calculate whatever value you need, store it in the pass-in field, and then use Sawtooth Script to print it out wherever it is required.
If the respondent does not know the hours and minutes exactly, the follow-up question is a select-question with brackets. So to make calculations with this brackets, i have made a constructed list with the average of the brackets (with the initial bracketquestion as parent). I prefer to combine the responses on the question on the exact hours /minutes and the responses on the backet-question in 1 list, so i can make calculations with that list.

But if i can combine those responses in another way, it is also fine by me. Could you let me know how to do this?  

To wrap up, this the structure of my survey:

Q1: how much time you spend on  activity?
- List1: hours
- List2: minutes
- i don't know

If i don't know:
Q2: could you give an indication
a) 0-0,5 hour
b) 0,5 -1 hour
c) 1 - 1,5 hour
d) etc

Q3: are you willing to pay an [amount of hours (Q1 or Q2) * price per hour] on the activity?


exact hours and minutes spend on activity
I haven't seen your how your .ssi is set up, but it's basically going to be some unverified Perl like this that reads the responses to the previous questions and does some math on it:

[% Begin Unverified Perl
my $hours;
my $q1Resp = GETVALUE('Q1');
if ($q1Resp == 1) {
    $hours = 1;
elsif ($q1Resp == 2) {
    $hours = 2;
return $hours * 7;
End Unverified %]

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.