# Namespace filterFactory
Functions to create date, text, or numeric filters on specified data.
Filters created with these functions can be used to:
- Filter explicit queries by query components or query functions
- Filter or highlight queries used by UI components, such as charts
- Set the filters of filter components
# Example
Example of using React hook useExecuteQuery
to query the Sample ECommerce
data source.
Factory function filterFactory.greaterThan()
is used to create a filter on Revenue
to get values
greater than 1000.
const { data, isLoading, isError } = useExecuteQuery({
dataSource: DM.DataSource,
dimensions: [DM.Commerce.AgeRange],
measures: [measureFactory.sum(DM.Commerce.Revenue)],
filters: [filterFactory.greaterThan(DM.Commerce.Revenue, 1000)],
});
if (isLoading) {
return <div>Loading...</div>;
}
if (isError) {
return <div>Error</div>;
}
if (data) {
return <div>{`Total Rows: ${data.rows.length}`}</div>;
}
return null;
# Index
# Functions
- between
- betweenNotEqual
- bottomRanking
- contains
- dateFrom
- dateRange
- dateRelative
- dateRelativeFrom
- dateRelativeTo
- dateTo
- doesntContain
- doesntEndWith
- doesntEqual
- doesntStartWith
- endsWith
- equals
- exclude
- greaterThan
- greaterThanOrEqual
- intersection
- lessThan
- lessThanOrEqual
- like
- measureBetween
- measureBetweenNotEqual
- measureEquals
- measureGreaterThan
- measureGreaterThanOrEqual
- measureLessThan
- measureLessThanOrEqual
- members - Creates filter on attribute to match certain string values
- numeric
- startsWith
- thisMonth
- thisQuarter
- thisYear
- today
- topRanking
- union
# Namespaces
- logic Beta