Have an idea?

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

Add a column in a grid question if previously the input in that column was more than 0


I have a numeric grid question with 18 columns.
On the following question, I want to pipe as a column only the columns where the answer on the r1 > 0 on the previous numeric grid question.
Does anyone know how to do that?

Thanks in advance!
asked Mar 9 by Tamara

1 Answer

0 votes
I'm not sure of your grid direction and grid structure (number of rows)?

You can use functions like AIG(Q1,0) in a constructed list to assist here. Certainly look up the HELP in Sawtooth Software by hitting the F1 key.

Also, as an alternative, if you insert this Perl script into a constructed list, that should give you the solution you desire ...
Begin Unverified Perl

 my $i=1;

 for($i=1; $i<=18; $i++)
   if (VALUE("Q1_r1_c".$i)>0)

End Unverified

In the above Perl script, I have assumed your grid question is Q1 and it uses a parent list in the columns called Q1ColList. Please change these accordingly.
answered Mar 10 by Paul Moon Platinum (74,205 points)