Have an idea?

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

How can you add a column in a grid question if previously the input in that row was more than 0?

Hi there,

so following issue:

I have a Question (Q1) with the following rows in grid for numeric values:

Now in the following questions I have another grid question where I want the columns to be e.g. X, if in Q1 the input was >0 or Y, if in Q1 the input was >0 have both if both logics are fulfilled.How can I do that? Maybe with a constructed list?

Thanks in advance!
asked Mar 5 by Max

1 Answer

0 votes
A constructed list is definitely the way to go.  Here's code you can use for the constructed list:

Begin Unverified Perl
my $gridQ = 'GridQ';
my $plist = 'list1';
for (my $r = 1; $r <= 2; $r++) {
    if (GETVALUE($gridQ . '_r' . $r . '_c1') > 0) {
        ADD($plist, $r);
End Unverified

Line 2 should be updated with the name of the grid question.  Line 3 should be updated with the name of the predefined list (the list used for Q1's rows).
answered Mar 5 by Zachary Platinum Sawtooth Software, Inc. (96,075 points)