This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

Creating a new pattern example

This example shows how the DD/MM/YYYY pattern can be created. This ensures that the respondent enters a date with day-month-year format, where the year part can include a two-digit century.

The separator between day/month and month/year can be any of "/", "-" or ".".

All these are valid dates: 06/08/2003; 6-8-2003; 06.8.2003; 6/08/03 for this pattern.

Examples of invalid dates are: 6th August 2003; 06/Aug/2003.

This example shows how to create patterns using buttons and dialog boxes. You can also create patterns by using the context menu in the Match pattern dialog.

  1. Select Tailor | Patterns to open the Patterns dialog.

  2. Select [New...] in the Patterns dialog to display the Pattern Properties dialog.
  3. Choose a name for the pattern and type it in to the Name box. Try to make the name as specific as possible to its purpose. For example, rather than write it as Date write it as DD/MM/YYYY so that its format can be identified easily by others using it.
    • Enter a Label giving more information. This will be displayed when the pattern is selected on the front page of the Patterns dialog.
    • You can enter a reference in the Reference giving specific details about where you accessed the information for the Pattern: for example, a website address; a database; a reference book.
  4. Select the response type that the pattern will be used with from the Usage drop-down list. Select Other Patterns Only for patterns that will not be available directly to variables, but only for use within other Patterns.

  5. You can create patterns by using a plain text string as a match, however, it is sometimes more effective to build the Match up from Components.

Creating components to use in your match

  1. Click [More>>] to display the Components part of the Pattern Properties dialog.

  1. Click [New...] to the right of the Components area to display the Component Properties dialog.

  2. Type in a Name for the Component you are writing. For example for DD/MM/YYYY you might call one of the components 'Day', which you would type in the Name space. In Label you might write 'Day part of Date'.
  3. Select [New...] to create a Match for the Component.
  4. The Match Pattern dialog displays.

    You build up the pattern to match from text and components. You can use the buttons on the dialog to select items, or right-click the Match field to display the context menu.

  5. Either type a text string into the Match box or double click one of the Global Patterns to select it.
    • For the day component you would want one digit or two digits recognised, as respondents would be likely to type in either one or two digits when answering this part of the question. For example: 01 or 1 when referring to the first day of the month.

    • If you are looking for a particular character click [Characters...] to show more options in the Character Selection dialog.
    • Highlight the characters required and click [OK]. If a letter is selected, both the lower and upper case version will show in the match unless Case Sensitive is ticked.
  6. For the first two-digit match of the Day example:

    either double-click digit in Global Patterns twice

    or double-click digit and then use [Repeat...] to permit multiple copies.

    The [Repeat...] button gives options for each part of the Component. Ensure that the part of the Component you want to affect is highlighted before selecting a Repeat command. Each of the commands creates constraints which the data must adhere to in order to fit the pattern.

    Pattern repeat dialog: 1 to 2 times

  7. Click [OK] to return to the Match Pattern dialog and [OK] again to return to the Component Properties dialog.
  8. Once satisfied with all the Components, return to the Pattern Properties dialog.

Deleting components

If you wish to delete any of the Components, highlight it and click [Delete]. Snap will display a warning message to confirm that you do want to delete the Component:

Creating the match from the components

  1. On the Pattern Properties dialog you will see that you now have a list of Components but no overall Match for the pattern. Select [New...] under the Matches part of the dialog and the Match Pattern dialog will display again

    The newly built components will show in the left-hand column . You can now create a match from both your components and the existing Global Patterns. [Characters...] and [Repeat...] work in the same way as previously explained.

  2. Select the Day component, then Separator, Month, Separator, Century and Year.
  3. Click [OK] when you have finished and you will be returned to the Pattern Properties dialog.

See Also

Applying a pattern in the questionnaire window

Applying a pattern in the Variables window

Patterns during data entry

Composition of a pattern

Testing a pattern

Modifying, cloning and deleting patterns

Copying patterns between surveys