Have an idea?

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

Participant data as a lookup table


I have a weird request, any one can give me some ideas?

I have a matrix of information, something like :


I need to find all the names for ID 1,2,etc... to use in constructing lists

I thought of entering this data into participant data field and then try to work it into a Perl array/hash and then work on it.

Do you have any better ideas?
asked Dec 1, 2011 by Bahadir Ozkurt Gold (16,980 points)
Does this matrix of information come in the form of respondent sample fields? Is it being captured during the survey? If you could be a bit more detailed, that would be great.
I have it beforehand, so I can enter it into a text or participant data section...
If you have it as a csv, you can upload it to a sql db, then access it via asynch call, or loop onto a php page and pass the variables that result from your php-sql code.

Another option is to access the csv file from your unverified perl.  I've seen this once (a long time ago), so I can't tell you how to do it, just that it's possible.
I guess I'll just read a file into perl hash and do some text manipulation in the end, thanks anyway

1 Answer

0 votes
I have ended up with the following:
I've realized that the second column wasn't crucial and have changed my data to read

and then I've used this to split the stored numbers and add based each items value
Begin Unverified Perl
    my @bayis;
    @bayis = split(/,/,VALUE("bayiler"));
    foreach my $bayi (@bayis) 
            ADD("BayiList", $bayi);
End Unverified
answered Dec 6, 2011 by Bahadir Ozkurt Gold (16,980 points)
Is this data for your bayis array derived from data copied and pasted into a merged field?
yes Ryan. my problem was that the data originally was in a multiple row per respondent format. I carried the multiple row part into single row separated with commas and then used the code above to build my lists.
Thanks for the clarification!