When creating advanced reports, you may specify a custom variable within
the WHERE clause (for example, $custom_variable). Once
declared within the SQL script text, you can to view and edit the variable by
clicking Edit Parameters the Edit Advanced Report
Template page. You are prompted to enter a value for the variable when you run
the report.
Optional: Add a filter in the WHERE section of your
script.
For example, this example script filters out transfers that do not have a
reported policy and transfers that do not fall within the specified date
range.
...
WHERE
ts.reported_policy IS NOT NULL
AND
ts.started_at < '$REPORT_PERIOD_END'
AND (
ts.stopped_at >= '$REPORT_PERIOD_START'
OR ts.stopped_at IS NULL
)
...
Create your report. You can also run it at this time.
Click Create: Save the report without running it. You are
redirected to the Manage Report Types page where you can see the new report
in the list of reports. Custom reports have edit and
delete links, which differentiate them from
Console's built-in reports. Both custom reports and built-in reports include
a copy link for duplicating the report and a
run link to view run settings and generate the
report.
Click Create and Run: Save the report and run it. The new report
is added to the Manage Report Types page, but first, you are redirected to
the New Report page where you must finalize the report run settings and
click the Run Report button to run the
report.