Sequence Analysis: Selector and numeric variable

Scenario: Find people who have been to Australia, then the United States, and then Greece, where the cost of the Australian booking is greater than £1000, with a more than 10% increase in the cost of the US booking and then the Greece booking.

To get started, launch the Sequence Analysis wizard, then:

  1. Transactional Selection - right click and select the Bookings table as the transactional records to analyse.

  2. Grouping Table - set People as the table to group the bookings up to.

  3. Transaction Grouping - this is an optional step that allows additional grouping into the categories of an identified selector variable. No grouping variable is required here - simply click Next.

  4. Transaction Ordering - in this example:

    1. Drag and drop the Booking Date variable onto the drop-box.

    2. Leave the default order as Earliest to Latest.

    No maximum gap between transactions is necessary here - click Next.

  5. In the Pattern Type step, select Selector and Numeric Variables.

  1. In the Pattern Definition step:

    1. Drag and drop the Destination variable as the selector variable to use.

    2. Select Manual from the Pattern definition type drop-down options.

    3. Click Set pattern and define the categories you wish to pattern match - here:

    4. Click OK and move onto the next step.

  1. In the Value Definition step:

    1. Drag and drop the Cost variable as the numeric variable to use.

    2. Select Manual from the Pattern definition type drop-down options.

    3. Click Set pattern and define the numeric values you wish to pattern match - here:

      For more on the pattern elements you can include when creating sequences on selector and numeric variables see Sequence Analysis: Pattern Definition and Sequence Analysis: Value Definition.

    4. Give the pattern a description - here Aus-USA-Greece then OK and Next.

      The pattern name of the numeric value must exactly match that used for the selector.

  1. In the Pattern Return Value step, leave the default settings to select the First - By Start Date and return the Pattern Name on the Grouping Table.

  1. Give your expression a meaningful description.

  1. In the final step of the wizard, you can review the defined settings. If necessary, navigate back through the steps and edit , or click Finish to create the on the fly aggregation expression.

You can now use the pattern match expression to continue your analysis. For example:

  1. Drag and drop the expression onto a new People level selection and enter the pattern Aus-USA-Greece.

    Building the selection returns a count of 7 people who currently match the defined pattern

  2. Drop a data grid onto the selection and add Booking Date, Destination and Cost.

  3. Group by Person URN and build.

  4. Sort into ascending order by booking date.

You can see that each person satisfies the pattern by:

  • Having a sequence of bookings that is Australia followed by the United States and then Greece;

  • The cost of the Australian booking being more than £1000;

  • The cost of the US booking being more than 10% higher than the Australian booking;

  • The cost of the Greece booking being more than 10% higher than the US booking,

 

Related topics: