Data filters
From SpinetiX Support Wiki
This page is about the data filters used within data feed widgets. See also Data parsers page.
Contents
Introduction
The information retrieved by a data feed widget (available only to Elementi X users) from a data source is parsed and arranged in a table-like format, with columns and rows, using any of the built-in data parsers.
To filter the resulted data set, so that only the meaningful rows of data can be displayed on the screen, the following filters are available within the "Data Properties" dialog:
To use any of these filters, follow these steps:
- Enter / select a column name under the "Format" option.
- Select Num. Filter, Date Filter, or String Filter from the drop-down box next to it.
- Click the "Add" button.
- A new tab is added with the name of the filter and the name of the column - click on it.
- Specify the filter criteria as detailed below.
- Click the "Test" button to see the results.
- Click the "OK" button to save the changes.
Num. Filter
Added in Elementi 3.1.0.
This filter removes any rows for which the specified criteria is not satisfied. This filter must be used on a column with numbers.
It offers the following options:
- Equals
- Enter the number against which the data in the entry column is compared - if the result is true, then the respective data row is kept in the data set, otherwise it is removed.
- Not Equals
- Enter the number against which the data in the entry column is compared - if the result is false, then the respective data row is kept, otherwise it is removed.
- In Range
- Enter the minimum and / or maximum numerical values (inclusive or not), against which the data in the entry column is compared - if the result is true, then the respective data row is kept in the data set, otherwise it is removed.
Date Filter
Added in Elementi 3.1.0.
This filter removes any rows where the respective date is not within the specified criteria. This filter must be used on a date column.
It offers the following options:
- From
- Specify the starting date and time used for filtering - if the date in the entry column is after, then the respective data row is kept in the data set, otherwise it is removed. The following options are possible:
- Date
- Specify an absolute start date / time.
- Relative
- Select a date relative to the moment when the data is parsed and filtered, such as: "Now", "Today", "Yesterday", "Current Month", "Last Year" etc.
- Custom
- Enter a starting date using a custom date string.
- Date
- Specify the starting date and time used for filtering - if the date in the entry column is after, then the respective data row is kept in the data set, otherwise it is removed. The following options are possible:
- To
- Specify the ending date and time used for filtering - if the date in the entry column is before, then the respective data row is kept in the data set, otherwise it is removed. The following options are possible:
- Date
- Specify an absolute end date / time.
- Relative
- Select a date relative to the moment when the data is parsed and filtered, such as: "Now", "Today", "Tomorrow", "Current Month", "Next Year" etc.
- Duration
- Specify a duration relative to the starting time specified under "From".
- Custom
- Enter an ending date using a custom date string.
- Indefinite
- Select this in order to use only the starting date in the filter.
- Date
- Specify the ending date and time used for filtering - if the date in the entry column is before, then the respective data row is kept in the data set, otherwise it is removed. The following options are possible:
Custom date string
The custom date string can be entered using one of the following expressions:
offset relative_date offset relative_date time offset relative_time time
where:
-
offset
- The offset applied to
relative_date
orrelative_time
as a signed integer (e.g.,-12, -5, -1, +1, +2, +30
etc.) or the wordthis
(instead of using 0).
- The offset applied to
-
relative_date
- The relative date specified using one of the following keywords:
-
day
,days
,- Examples: "this day", "+1 day", "-5 days".
-
month
,months
,month-dd
,months-dd
,- Note:
dd
is a fixed day during that month. - Examples: "this month", "this month-10" (means the 10th day of the current month), "+1 month-31" (means last day of next month);
- Note:
-
year
,years
,year-mm
,years-mm
,year-mm-dd
,years-mm-dd
,- Note:
mm
is a fixed month anddd
is a fixed day during that year. - Examples: "-1 year" (means last year), "this year-12-1" (means December 1st of this year);
- Note:
-
monday
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
(i.e. the day of the week in English lowercase format)- Examples: "-2 sunday" "this monday", "+3 friday" etc.
-
- The relative date specified using one of the following keywords:
-
time
- The fixed time during the specified date, if any, using
hh, hh:mm, hh:mm:ss
. - If not provided, then 00:00:00 is used for start date (From) and 23:59:59 is used for end date (To). If some or all time-notation elements are provided, they are replaced within the default ones.
- Examples: "15" (defaults to 15:00:00 for start date, respectively 15:59:59 for end date), "07:30", "22:50:45".
- The fixed time during the specified date, if any, using
-
relative_time
(added into 3.1.0)- The relative time specified using one of the following keywords: "hour", "hours", "minute", "minutes", "second", "seconds".
- Examples: "-3 hours", "+5 minutes", "+150 seconds".
This weekday
The filter options about the weekdays from the "Relative" drop-down box ("This Monday" to "This Sunday") or specified within the "Custom" field ("this monday" to "this sunday") refer to the current week and are evaluated when the data is parsed - if that moment is:
- before the specified weekday, "this" means "next"
- after the specified weekday, "this" means "last"
- current day when the two match
Before or after is straightforward, except for Monday and Sunday, because the week can start on Monday or on Sunday (as used in United States, Canada, and Australia), depending to the selected locale. Here are the cases that could be confusing:
- When the condition is "This Monday" and the filter is evaluated on a Sunday, that actually means last Monday when the week starts on Monday and next Monday otherwise.
- When the condition is "This Sunday" and the filter is evaluated on Monday, that actually means next Sunday when the week starts on Monday and last Sunday otherwise.
String Filter
Added in Elementi 3.1.0.
This filter removes any rows for which the specified criteria is not satisfied. This filter must be used on a column with texts.
It offers the following options:
- Equals
- Enter the string against which the data in the entry column is compared - if the result is true, then the respective data row is kept in the data set, otherwise it is removed.
- Not Equals
- Enter the string against which the data in the entry column is compared - if the result is false, then the respective data row is kept, otherwise it is removed.
- Matches
- Enter a regular expression (RegExp) to be applied over the data in the entry column - if there's a match, then the respective data row is kept, otherwise it is removed.