QScript FilterTerm

From Q
Jump to navigation Jump to search

FilterTerm

A wrapper for FilterTerm that provides a clean interface for QScript. This wrapper exposes the essential properties and methods of FilterTerm without exposing the entire C# type hierarchy to QScript users.

controlGuid

The GUID of the associated control (if control-based).

controlLabel

The display label of the associated control (if control-based).

dataFile

Gets the DataFile that this filter term belongs to.

display(for_debug)

Returns a display string for this filter term.
for_debugWhether to include debug information in the display.

equals(obj)

Whether two objects are the same.
objThe object to compare against.
Returns:true or false
Example:
data_file.getQuestionByName('Q2').equals(data_file.questions()[0])

getFilter()

Gets the filter values as an array of booleans for the current data.

input

The input object (Question or Variable) that this filter term operates on.

isControlBased

Whether this filter term is based on a control (dynamic values).

label

Optional label for this filter term.

negated

Whether this filter term is negated (NOT).

operator_string

The operator used for filtering (e.g., "Any of", "Equals", "Contains text").

shortString(translate)

Returns a short display string for this filter term.
translateTranslation object for localized strings. Optional.

type

Returns 'FilterTerm'.

validate()

Validates this filter term and returns any errors.

values

The values used in the filter operation.