Adding Filters

Adding Filters

OVERVIEW

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%%


    • Related Articles

    • Creating a Custom Report

      OVERVIEW The Custom Reports module allows you to create custom reports to supplement the native Pluto LMS reports. Note: This may require the assistance of a developer. USE CASE EXAMPLE: Improving Onboarding Training Company: XYZ Corporation ...
    • Custom Profile Fields

      OVERVIEW Customize what information you wish to collect from your LMS users by creating new profile categories and fields. In Pluto LMS, custom profile fields allow administrators to create additional fields to gather and store specific information ...
    • Custom Domain Setup

      OVERVIEW If you would like to avoid your end-users accessing a "plutolms" domain, you can add a custom domain to your LMS site. This will become the new URL to which your LMS can be accessed. SETUP CUSTOM DOMAIN Step 1: Click on "Site Admin", ...
    • Getting Started with Custom CSS

      OVERVIEW Pluto LMS offers a custom CSS editor which enables you the ability to add your own CSS code to customize your LMS theme. Custom CSS refers to the practice of adding your own Cascading Style Sheets (CSS) code to a website or web application ...
    • Reports API

      block_configurable_reports_get_report_data Arguments reportid (Required) The report id General structure int //The report id REST (POST parameters) reportid= int How to connect to 3rd party data analysis tools: You can also connect to tools like: ...