Filters are query parameters associated with UI controls that narrow down the returned query results. There are two types of filters, predefined and custom filters. By definition, any filter that is not predefined is a custom filter. This page documents Cluvio's predefined filters. For custom filters, please see the Custom Filters.
Time Range Filter
A time range filter is a predefined filter that allows to narrow the data shown by a report to a time range. The general format for a time range filter is
{<expr>=timerange}
where <expr> is a SQL value expression, e.g. a column name. When used, e.g. as in
SELECT SUM(revenue) FROM sales WHERE {saletime=timerange}
the following control appears on a dashboard containing the report (note that this is the same control as for the simple time range parameters):
The executed SQL will contain an appropriate condition substituted for the parameter according to the selected time range, e.g.
... WHERE saletime >= '2016-09-12T00:00:00Z' AND saletime <= '2016-09-22T23:59:59Z')
The following is the full list of supported time range filters, all associated with the same UI control:
Parameter | Description |
{<column_expr>=timerange} | Filters the values designated by <column_expr> by the selected timerange. |
{<column_expr>=timerange_previous} | Filters the values designated by <column_expr> by the time range preceding the currently selected time range (i.e. of the same duration). |
The following is a list of additional parameters associated with the timerange filter:
Parameter | Description |
{timerange_start} | The beginning of the selected timerange, defaulting to 01/01/0000 in case there is no start date. |
{timerange_end} | The end of the selected timerange, defaulting to 23/12/9999 in case there is no end date. |
{timerange_start_tz}, {timerange_end_tz} | Variants of {timerange_start} and {timerange_end} that adjust the value according to the organization's timezone settings. |
{timerange_seconds} | The number of seconds in the selected timerange. |
{timerange_interval} | The interval of the selected timerange. |