Add functions to a Query Wizard filter

Path: Reporting > Ad Hoc Reporting > Filter Designer > Function Editor

Use the Function Editor to create calculated fields, combine values, summarize data, and perform aggregate calculations within an Ad Hoc filter. Functions can be added to the filter and included in Data Export output alongside standard fields. This guide explains how to add and manage functions in Query Wizard.

Before you start

  • Determine the calculation or summary you want the filter to perform.
  • Add the fields needed for the calculation before opening the Function Editor.
  • Verify you have the appropriate tool rights to create and save filters.


Open the Function Editor

Ad Hoc Query Wizard Field Selection page with available field categories, an empty Selected Fields panel, and an Add Function button for adding calculated fields to the query.Use the Add Function feature to create calculated fields that can be included in a query.

  1. Create a new Query Wizard filter or edit an existing one.
  2. Click Add Function.
  3. The Function Editor appears in a new window.
Function Editor dialog with fields for a function name and type, a constant value field with an Add button, and lists for selecting fields and parameters used in the function.Use the Function Editor to define and configure calculated fields for use in a query.


Define the function

  1. Enter a Name for the function. This name distinguishes the function from other functions in the Selected Fields window and in filters generated via the Data Export tool.
  2. Select a Function from the drop list. Once a function is selected, the Filter By Search field becomes active. 
    • If the "Constant" Function is selected, enter the Constant Value and click the Add button. The value entered displays in the Parameters window and is reported on every record returned.
  3. Use the Filter By Search field to search for desired fields. Enter a search value, then click the Search button to reset the list of fields to return only matching fields. Click the Clear button to clear the entered search values and see the full list of fields.
  4. Search for and select the fields that should be included in the calculation.
  5. Verify the selected fields appear in the Parameters area.
  6. Repeat steps 2 -6 if additional functions are required.
  7. Click Save.


Ad Hoc Query Wizard Field Selection page with a calculated function displayed in the Selected Fields list alongside student name fields.Use this view to verify that a calculated function has been added to the query output and included with the selected fields.

Impact

The Field Selection editor displays after the function is saved. The new function is added to the Selected Fields window and can be used like any other field in the filter. Function names display in the format function.functionName, where the function name appears after the period.

The function becomes available for output formatting, grouping, aggregation, and Data Export processing. Because function values are calculated each time the filter runs, the results automatically reflect the current data it returns. This allows you to create dynamic calculations, summaries, counts, and combined values without manually updating the filter.


Edit a function

  1. Select a saved function from the Selected Fields list.
  2. Click Edit Function.
  3. Update the function name, parameters, or calculation.
  4. Click Save.

Impact

The function becomes available as a field within the filter and can be included in exported results.


What's next

  • Configure Output Formatting to control how function results display in exports.
  • Use Grouping and Aggregation to summarize function results across record groups. 
  • Test the filter to verify that function calculations return the expected results.
  • Save the filter to a folder for easier organization and access.


Appendix - Function descriptions

Function Description Example
Constant

Outputs the Constant Value entered on each record returned when the filter is exported.

Constant Value = District 001


Every exported record contains "District 001". 


Coalesce

Use when multiple fields may contain similar information, and you want the first available value.


Logic pulls field values in the order in which the fields are selected in the Function Editor.

  1. Federal Race Ethnicity
  2. Race Ethnicity Determination

If the first field is blank, Query Wizard returns the value from the second field.

 Concatenate

Combines multiple fields into a single output value.


Gender + Race Ethnicity


F Hispanic
M Asian


Add

Combine numeric values.


Fee Debit + Fee Credit

 

Result = Total fee balance

Subtract

Calculate the difference between fields.

 Total Fees - Total Paid


Result = Outstanding balance

Multiply Calculate products.

Hours per day x Days worked


Result = Total hours worked

Divide

Calculate percentages or ratios.

Fees paid / Total fees 


Result = Percent paid

Record Count

Count the number of records returned.



Count behavior events by grade


Result 

  • Grade 9 = 125 events
  • Grade 10 = 98 events
Distinct Count

Duplicate values are only counted once.



Count unique students involved in behavior events.


Result = A student with multiple events is counted one time.

MIN

Return the smallest value for the field.


  

  


  

  


  

  


  

  

MAX

Return the largest value for the field.

SUM

Total numeric values.

AVG

Determine an average value for a field.