Filtering Data Using Simple Query Filters

Objective

After completing this lesson, you will be able to identify the components of a query filter and how they function together to refine data results in a Web Intelligence document.

Filter Data with Query Filters

A query filter is an instruction you give to the database when you request information. This instruction tells the database to select and return only the data that matches the criteria you define. You apply this filter in the Query panel before the data arrives in your Web Intelligence document. In other words, you filter the data at the source.

For example, if your database contains all your company's sales data:

  • Without a query filter, when you request the Country, Year, and Sales revenue objects, the database sends the entire set of sales data for all countries and all years.
  • With a query filter, you specify Country = 'France' and Year = 2024. The database then returns only the rows that meet these two conditions.
Diagram illustrates a Web Intelligence document with a microcube connecting query filters to two reports containing tables of sales revenue by year and state.

Advantages of the Query Filter

  • Improved performance: The document loads faster because the database processes and transfers a smaller volume of data.
  • Data relevance: The document contains only the information you need, making it clearer and easier to analyze.

Use Predefined Query Filters

Predefined query filters are preset filters, usually created by a database administrator and stored in the universe. You can reuse these filters across multiple queries and documents, which ensures consistent filtering criteria.

Create Query Filters

Watch the video to define the components of a query filter.

List of Operators

Operators perform different actions based on their context. You can use operators to do math, combine text, or compare values to return true or false.

A filter for State uses the In List operator, with a dropdown menu of comparison options expanded.

The Operators drop-down list provides options such as:

OperatorRetrieves dataExampleData retrieve
Equal toEqual to a specified value.Country - Equal to USFor the US only.
Greater than or Equal toGreater than or equal to a specified value.Revenue - Greater than or equal to 10,000For revenue of $10,000 or greater.
Less than or Equal toLower than or equal to a specified value.Customer age - Less than or equal to 30For customers aged 30 or less.
BetweenIncluding and between two specified values.Weeks - Between 25 and 36For all weeks excluding week 25 through to 36.
In ListSame as specified values.Country - In list 'US; Japan; UK'For US, Japan, and UK only.
Is nullFor which there is no value in the database.Children - Is nullFor customers without children, where no value is entered as a value in the children column.

List of Operands

You use the operand to enter values that filter the object.

A filter for Store name equal to e-Fashion Dallas uses the Value(s) from list option selected in the dropdown menu.

You can select from the following operands:

  • Constant: You compare the object against a constant value to filter the query result.
  • Value(s) from List: You compare the object against values from a list of values to filter the query result.

Let's Summarize What You've Learned

  • Query filters select and return only data that matches your defined criteria, improving data relevance and performance.
  • You can use predefined query filters for consistent filtering or create custom filters for specific needs.
  • A query filter consists of an object, an operator, and an operand to define filtering conditions.
  • Operators and operands determine how data is compared and which values are included in the query results.

Restrict Data Using a Simple Query Filter

Business Example

Your manager asks you to analyze the sales revenue across various stores. Initially, focus on the revenue generated in 2024, and subsequently refine your search to examine specific performance in Florida and New York.