TouchPoint responses are linked to programs but not to specific program enrollments, so if you allow participants to be enrolled in a program multiple times and you need to know which responses were taken within each enrollment, follow these steps.
Using Flattened Data
When you are working with flattened TouchPoint data, pulling in the program name from the enrollment folder could inflate your data, creating duplicated response IDs.
Step 1: Build Your Query
Include the following objects in the query from the Program Enrollment folder: [Program Name] and [Program Unique Identifier]
Run your query.
Notice that for the same participant, the same TouchPoint response duplicates for each program the participant is enrolled in.
This is because TouchPoint responses are linked to the participant and program enrollment is linked to the participant, but TouchPoint responses and program enrollment are not linked to each other. Because of this, the report overcompensates by creating a line of data for each possible combination, which inflates the data, or creates a Cartesian product.
If you remove program enrollment data from the table, the duplicated rows are removed, as see below.
Step 2: Flag a TouchPoint Taken in a Date Range
Make sure you have [Program Start Date] and [Program End Date] from the Program Enrollment folder in your query. Add these objects to your table.
You may have participants that do not have a Program End Date. We'll come back to this later.
Create a variable called Flag - TP Completed in Enrollment Date Range using the formula:
=(If [Date Taken_1566] Between([Program Start Date];[Program End Date]) Then 1)
Add the flag to the table. This will assign a 1 to any response taken during the enrollment date range.
You'll notice that any participant who does not have a Program End Date does not get flagged. We'll need to add a varibale to account for a null Program End Date.
Step 3: Create a Variable for Null Program End Date
Create a new variable called Program End Date New using the following formula:
=(If IsNull([Program End Date]) Then CurrentDate() Else [Program End Date])
You can pull it into the table next to Program End Date to see the difference. This formula replaces the null value with today's date.
Step 4: Add Program End Date New to your Flag variable
Update Flag - TP Completed in Enrollment Date Range to include the Program End Date New variable.
Flag - TP Completed in Enrollment Date Range
=(If [Date Taken_1566] Between([Program Start Date];[Program End Date New]) Then 1)
You should now see a flag on anyone currently enrolled.
Step 5: Add Program Clause to Flag Variable
Now you'll want to ensure that the flag is only flagging the program that the response was recorded in. With the current flag, it is flagging anyone whose program start/end dates lie in the date range in any program.
Add an additional clause to the Flag - TP Completed in Enrollment Date Range variable.
=If [Date Taken_1566] Between([Program Start Date];[Program End Date New]) And [Completing Program Unique Identifier_1566] = [Program Unique Identifier] Then 1
Your flag variable should now look like this:
With the flag in the table, only the response within the program enrollment date range and the program where the TouchPoint was completed is being flagged.
Step 6: Filter the Table using the Flag Variable
To add a filter to the table, navigate to Analysis tab > Filters > Add Filter
In the Report Filter window, select Add Filter > Select the Flag variable > OK
Set the Flag - TP Completed in Enrollment Date Range equal to 1.
With the filter applied to the table, you should only see 1 row of data for each TouchPoint Response ID. You can hide the Flag variable from the table or remove it altogether. The filter will stay attached to the entire report.