API reference
Table of contents

ConditionalQueryObject

Refers to the filter by condition for number, string, date, and time fields. Check if the conditional filter is supported for your data source in Flexmonster’s technical specifications

Properties

Available properties depend on the field’s type. Only one property can be specified at a time.

Note MDX queries are not supported by the conditional filter. Use only the properties described in this section.

Number

Property/Type Description
equal
Number
Equal to the specified number.
Example: { "equal": 5 }.
not_equal
Number
Not equal to the specified number.
Example: { "not_equal": 5 }.
greater
Number
Greater than the specified number.
Example: { "greater": 5 }.
greater_equal
Number
Greater than or equal to the specified number.
Example: { "greater_equal": 5 }.
less
Number
Less than the specified number.
Example: { "less": 5 }.
less_equal
Number
Less than or equal to the specified number.
Example: { "less_equal": 5 }.
between
Number[]
Between the specified numbers (including them).
Example: { "between": [0, 5] }.
not_between
Number[]
Not between the specified numbers (excluding them).
Example: { "not_between": [0, 5] }.

String

Property/Type Description
equal
String
Equal to the specified string.
Example: { "equal": "aaa" }.
not_equal
String
Not equal to the specified string.
Example: { "not_equal": "aaa" }.
begin
String
Begins with the specified string.
Example: { "begin": "aaa" }.
not_begin
String
Does not begin with the specified string.
Example: { "not_begin": "aaa" }.
end
String
Ends with the specified string.
Example: { "end": "aaa" }.
not_end
String
Does not end with the specified string.
Example: { "not_end": "aaa" }.
contain
String
Contains the specified string.
Example: { "contain": "aaa" }.
not_contain
String
Does not contain the specified string.
Example: { "not_contain": "aaa" }.
greater
String
Greater than the specified string.
Example: { "greater": "aaa" }.
greater_equal
String
Greater than or equal to the specified string.
Example: { "greater_equal": "aaa" }.
less
String
Less than the specified string.
Example: { "less": "aaa" }.
less_equal
String
Less than or equal to the specified string.
Example: { "less_equal": "aaa" }.
between
String[]
Between the specified strings (including them).
Example: { "between": ["aaa", "bbb"] }.
not_between
String[]
Not between the specified strings (excluding them).
Example: { "not_between": ["aaa", "bbb"] }.

Date

The filter accepts dates in the "YYYY-MM-DD" format. 

Note The filter does not work for the "date" field type. Fields of this type can be filtered only with selection or value filters.

Property/Type Description
equal
String
Equal to the specified date.
Example: { "equal": "2018-12-31" }.
not_equal
String
Not equal to the specified date.
Example: { "not_equal": "2018-12-31" }.
before
String
Before the specified date.
Example: { "before": "2018-12-31" }.
before_equal
String
Before or equal to the specified date.
Example: { "before_equal": "2018-12-31" }.
after
String
After the specified date.
Example: { "after": "2018-12-31" }.
after_equal
String
After or equal to the specified date.
Example: { "after_equal": "2018-12-31" }.
between
String[]
Between the specified dates (including them).
Example: { "between": ["2018-12-31", "2018-12-31"] }.
not_between
String[]
Not between the specified dates (excluding them).
Example: { "not_between": ["2018-12-31", "2018-12-31"] }.
last
String
Shows dates of a previous period. The period can be one of the following: "day", "week", "month", "quarter", "year".
Example: { "last": "week" }.
current
String
optional Shows dates of a current period. The period can be one of the following: "day", "week", "month", "quarter", "year".
Example: { "current": "week" }.
next
String
optional Shows dates of a next period. The period can be one of the following: "day", "week", "month", "quarter", "year".
Example: { "next": "week" }.

Time

The filter accepts time periods in the following formats:

  • "Xs" – X seconds. Example: "5s".
  • "Xm" – X minutes. Example: "5m".
  • "Xh" – X hours. Example: "5h".
  • "Xd" – X days. Example: "5d".
Property/Type Description
equal
String
Equal to the specified time period.
Example: { "equal": "30m" }.
not_equal
String
Not equal to the specified time period.
Example: { "not_equal": "30m" }.
greater
String
Greater than the specified time period.
Example: { "greater": "30m" }.
greater_equal
String
Greater than or equal to the specified time period.
Example: { "greater_equal": "30m" }.
less
String
Less than the specified time period.
Example: { "less": "30m" }.
less_equal
String
Less than or equal to the specified time period.
Example: { "less_equal": "30m" }.
between
String[]
Between the specified time periods (including them).
Example: { "between": ["30m", "1h"] }.
not_between
String[]
Not between the specified time periods (excluding them).
Example: { "not_between": ["30m", "1h"] }.

Example

The example below shows how the ConditionalQueryObject is used to create a conditional filter for a string field:

slice: {
  rows: [
    {
      uniqueName: "Country",
      filter: {
        query: {
          between: ["P", "V"],
        },
      },
    },
  ]
}

Check out the example on JSFiddle.

See also

Filter by condition
FilterObject