Constructed List Using perl

Hi,

I need to create a list of brands a person has SHOPPED at, but NOT made a purchase. This is based on two numeric grid questions:

Q4. How many times have you shopped at each of the following home improvement stores during the past 60 days, whether or not you made a purchase?

Q10. You said that you had shopped at each of these home improvement stores a certain number of times in the past 60 days. How many of those times did you actually make a purchase the past 60 days?

I need a list created where Q4>0 AND Q10<Q4 (indicating they have shopped, and they have purchased fewer times than they have shopped). Q10 is populated from a Q4 constructed list ("ShoppedwithOth").

I tried this Perl, but I'm very new at it and I can't figure out why it's not working:


Begin Unverified Perl


if ((VALUE("Q4_r1_c1")>0) &&
((VALUE("Q10_r1_c1") < (VALUE("Q4_r1_c1")) ) ) {
ADD("ShoppedWithOth",1);
}


if ((VALUE("Q4_r2_c1")>0) && ((VALUE("Q10_r2_c1") < (VALUE("Q4_r2_c1")) ) ) {
ADD("ShoppedWithOth",2);
}


if ((VALUE("Q4_r3_c1")>0) && ((VALUE("Q10_r3_c1") < (VALUE("Q4_r3_c1")) ) ) {
ADD("ShoppedWithOth",3);
}


if ((VALUE("Q4_r4_c1")>0) && ((VALUE("Q10_r4_c1") < (VALUE("Q4_r4_c1")) )) {
ADD("ShoppedWithOth",4);
}


if ((VALUE("Q4_r5_c1")>0) && ((VALUE("Q10_r5_c1") < (VALUE("Q4_r5_c1")) ) ) {
ADD("ShoppedWithOth",5);
}

End Unverified


Would appreciate any help. Thanks!

Resolved
3 replies