Start your query:
- Navigate to Analysis, then click Information library
- Click Add an ad-hoc query
- Select source view of Sales Orders and click OK
Add fields to Include records where:
- In the left column, expand Sales Order Item, expand Sales Order Item Ticket, and select Program. From the middle, drag Program record into Include records where. Set Equal to the pre-registered program.
Add fields to Results fields to display:
- Within Results fields to display, highlight Lookup ID and click the red X to Delete
- In the left column, expand Sales Order Item, expand Sales Order Item Ticket, select Program Events. From the middle, drag Event record into Results fields to display.
- Within Results fields to display, highlight the Event record line. Click the SUM button and select COUNT.
Save your query:
- Click Set save options tab
- Name query
- Save and Close
Your final query will look similar to this:
Note: If this not a free program and you are charging per discount, you can instead create a smart field to show number of visits along with cost.