DQ respondents based on Zip Code with 30K Zip Codes

Does anyone have a the solution for screening respondents based on zip codes but for 30K zip codes? If I create Predefined List for 30K, the survey becomes very slow.

Slow Solution:

Paste the full list of valid zip codes into a parent list and call it ZipCodeList.

Let's assume there are 100 zip codes in this example.

Now create a constructed list called ZipCodeConList which uses the ZipCodeList as the parent list.

Insert this Perl script into your constructed list ...

Note 1: I have assumed your zip code question is S1.
Note 2: Change "$i<=100" according to the number of postcodes you have in your parent list ZipCodeList.


Begin Unverified Perl

 my $i=1;

 for($i=1; $i<=100; $i++)
  {
   if (VALUE("S1") eq LISTLABEL("ZipCodeList",$i))
    {  
     ADD("ZipCodeList",$i);
    }  
  }

End Unverified


So what we have happening here is your constructed list is matching the S1 response with the full list of valid zip codes stored in the ZipCodeList. When it finds a match, it stores it in the ZipCodeConList constructed list.

Now apply this skip condition in your termination skip ...

ListLength(ZipCodeConList)=0

This says if the constructed list (ZipCodeConList) is empty, there were no matches and therefore terminate.

Regards.

3 replies