When creating a custom report, you can add filters that function as a control which produces a subset of data.
ADDING A FILTER
In the relevant custom report, in the "Filters" tab, select the filter that you require from the "Add" drop-down list.
ADDING THE FILTER CODE TO YOUR SQL QUERY
These are the filters that can be used to constrain your report:
%%FILTER_COURSES:
%%FILTER_USERS:
%%FILTER_STARTTIME:
%%FILTER_ENDTIME:
%%FILTER_SYSTEMUSER:
%%FILTER_YEARNUMERIC:
This code needs to be added into the relevant section of your SQL query together with a logical operator to specify how the filter works.
For example, let's add a course filter to our SQL query:
Step 1: Go to the "Filters" tab then choose to add the "Courses" filter.
Step 2: In the "Custom SQL" tab, edit the Custom SQL query by adding %%FILTER_COURSES:c.id%% into the correct position (i.e. next to the course data table specification) within your SQL code.
Here is a sample SQL query when applying a course filter:

SELECT
u.firstname AS 'First Name',
u.lastname AS 'Last Name',
c.fullname AS 'Course Name',
ROUND(e.progress,0) AS 'Progress',
DATE_FORMAT(FROM_UNIXTIME(e.completiontime),'%d-%m-%Y') AS 'Complete Date'
FROM prefix_edwreports_course_progress AS e
JOIN prefix_user AS u ON e.userid = u.id
JOIN prefix_course AS c ON e.courseid = c.id %%FILTER_COURSES:c.id%%