Skip to content

Report with Opposing Criteria

Creating a Report with Opposing Criteria

This module builds reports based on multiple criteria (is x and y and z). Using the In Database function, you can merge two reports to create one report with opposing criteria (is x or y or z).

Note: You can currently only do this for reports which have 'Members' as the source.

  1. Click the green 'Create Report' button in the category you wish to create the report in;
  2. Create a report for the first part of the query, for example students who are in the School of Psychology (School = 13);
  3. Create another report for the second part of the query, for example students who are in the School of Computer Science (School = 17);
  4. Before joining the reports, they must both be added to the Member Report Cache, which you can do by clicking the green 'Cache Refresh' button in the category screen, after submitting each report;
  5. Once both reports have been added to the Cache, create a third report and set the source to 'Member Report Cache';
  6. Insert a column from the Members table here, such as name or student ID;
  7. Add the field 'report_id' as a Criteria;
  8. Set the 'In' Operator and set the values as the Report ID's you created in steps 2 and 3.
  9. Click 'Submit'.

This should now have created one report, merging the data from the two reports with their own criteria.


Example: You wish to create a report of students who are in the School of Psychology or the School of Computer Science. This could be useful when creating reports for elections, where you do not want courses to overlap.

Report 1:

Source Table:

Members

Columns:

student_id

schools.name

Criteria:

Column Operator Value Meaning
leaver_date Equals 0 Student is currently enrolled
schools.id Equals 13 Student is in School of Psychology

Report 2:

Source Table:

Members

Columns:

student_id

schools.name

Criteria:

Column Operator Value Meaning
leaver_date Equals 0 Student is currently enrolled
schools.id Equals 17 Student is in School of Computer Science

Report 3:

(Created after Reports 1 and 2 have been added to the Member Report Cache)

Source Table:

Member Report Cache

Columns:

name

student_id

Criteria:

Column Operator Value Meaning
report_id In 1,2 Pulling in data from the cached reports #1 and 2

Updated on 6th January 2020