Server User Guides > Survey Tabulation > Table specification syntax > Special elements > Autocoding text variables
 
Autocoding text variables
This example is based on the Museum sample data set.
address{London 'London' _
      expression('address.find(""london"") <> -1'),
  Liverpool 'Liverpool' _
      expression('address.find(""liverpool"") <> -1'),
  Aberdeen 'Aberdeen' _
      expression('address.find(""aberdeen"") <> -1'),
  Leeds 'Leeds' _
      expression('address.find(""leeds"") <> -1'),
  Edinburgh 'Edinburgh' _
      expression('address.find(""edinburgh"") <> -1'),
  OtherCities 'Other cities' _
        expression('address.find(""london"") = -1
    And address.find(""liverpool"") = -1 _
    And address.find(""aberdeen"") = -1 _
    And address.find(""Leeds"") = -1
    And address.find(""Edinburgh"") = -1
    And Not address.IsEmpty()'),
  NotAnswered 'Not answered' expression('address.IsEmpty()')}
This example creates an axis based on the address text variable and uses custom expressions to automatically code the responses into categories by using the Find function to search for city names.
See Find.
The text supplied as a parameter to the Find function is enclosed in two double quotation marks (""<text>"").
Here is a table that has this axis on the side:
Table showing variable autocoded using a custom expression
This graphic is described in the surrounding text.
See also
Special elements