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
- In the WHERE clause editor, click inside the text box.
- Type the SQL expression that defines your filter condition.
- Click the pencil icon on the right to open advanced settings with tools for building expressions.
- Use available keywords, tables, operators, or code helpers to complete your logic.
- Click Validate to check if the expression syntax is correct.
- Click Save.
- In the Options panel, select Save Data Source.
WHERE clause fields
| Field | Description |
|---|---|
| Script editor | Enter the SQL condition used to filter data in the cube. |
| Code helpers | Insert operators, brackets, or keywords using toolbar buttons above the script editor. |
| Scripts Keywords | Build expressions using grouped keywords:
|
| Tables | Select from tables available in the data source to reference in the script. |
| Others | Add additional elements:
|
| Validate | Check whether the script executes successfully and meets syntax requirements. |