Variable scope advanced usage and example

Variables can have 3 scopes (scope basically means where they can be used from).

Global scope - these variables can be used anywhere, on any report, dashboard

Dashboard scope - these variables are added to a dashboard and then can only be viewed and used on that dashboard

Report scope  - these variables are added to a report and can only be used and viewed from that report

An example of why you would use this feature is to create a report that you can use again and again with different time periods:

  1. Go to Settings, Reports, Create New Report and create a Report as below:

  2. Underneath Rows, click "Add Report Variable":

  3. Create the variable called 'period' as below:

  4. You will see now that you have a Report Scope Variable:

  5. Now click 'Add New Row' to the report as follows. Note that the date filter is set to this variable called 'period' which we just created. If you wanted more rows, you would do the same, make the date filter 'period', but for this example we will just do the one row.

  6. Now Create a new Dashboard. Click on the edit icon (pencil). Add the 'Consultations by time period' report TWICE.

  7. On the second report, click Settings.

      8. Scroll down and click "Report Scope", followed by "Period", and under"Override with", select a new "Date Range"

    9. Once you have selected this, save. You will see the second report has different values. So this allows you to create a report once, then use it multiple times for different variables.