Skip to main content

Build WHERE Clause

The WHERE clause editor, located at the bottom of the Data Source Editor, is used to filter the data loaded into the cube by applying SQL conditions. This filtering ensures only relevant records are processed during cube builds or refreshes, which can improve performance and reduce cube size.

When to build a WHERE clause

  • Filtering irrelevant data: Exclude records not needed for analysis to reduce cube size and improve performance.
  • Restricting data to specific criteria: Limit records to certain values, ranges, or statuses to match reporting needs.

Add a WHERE clause

  1. In the WHERE clause editor, click inside the text box.
  2. Type the SQL expression that defines your filter condition.
  3. Click the pencil icon on the right to open advanced settings with tools for building expressions.
  4. Use available keywords, tables, operators, or code helpers to complete your logic.
  5. Click Validate to check if the expression syntax is correct.
  6. Click Save.
  7. In the Options panel, select Save Data Source.

WHERE clause fields

FieldDescription
Script editorEnter the SQL condition used to filter data in the cube.
Code helpersInsert operators, brackets, or keywords using toolbar buttons above the script editor.
Scripts KeywordsBuild expressions using grouped keywords:

  • Functions – Perform standard calculations or data transformations using math or text functions.
  • BI Functions – Apply business intelligence logic, such as period-over-period comparisons or trend analysis.
  • Statements – Control the logic and structure of your expression such as CASE for conditional rules.
  • Operators – Add, compare, assign, or combine values using logical or arithmetic symbols.
  • Constants – Insert fixed values that do not change, such as numerical thresholds or static text.
  • Objects – Use advanced elements such as Hyperlink or special script functions to enhance interactivity or dynamic output.
TablesSelect from tables available in the data source to reference in the script.
OthersAdd additional elements:

  • Global Variables – Use predefined global values.
  • Special Variables – Use context-sensitive or system-generated values.
ValidateCheck whether the script executes successfully and meets syntax requirements.