Need a special offer?Find out if your project fits.
+
API reference
  • API Reference for older versions
  • 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
    Includes numbers equal to the specified number.
    Example: { "equal": 5 }.
    not_equal
    Number
    Includes numbers not equal to the specified number.
    Example: { "not_equal": 5 }.
    greater
    Number
    Includes numbers greater than the specified number.
    Example: { "greater": 5 }.
    greater_equal
    Number
    Includes numbers greater than or equal to the specified number.
    Example: { "greater_equal": 5 }.
    less
    Number
    Includes numbers less than the specified number.
    Example: { "less": 5 }.
    less_equal
    Number
    Includes numbers less than or equal to the specified number.
    Example: { "less_equal": 5 }.
    between
    Number[]
    Includes numbers between the specified numbers (including them).
    Example: { "between": [0, 5] }.
    not_between
    Number[]
    Includes numbers not between the specified numbers (excluding them).
    Example: { "not_between": [0, 5] }.

    String

    Property/Type Description
    equal
    String
    Includes strings equal to the specified string.
    Example: { "equal": "aaa" }.
    not_equal
    String
    Includes strings not equal to the specified string.
    Example: { "not_equal": "aaa" }.
    begin
    String
    Includes strings that begin with the specified string.
    Example: { "begin": "aaa" }.
    not_begin
    String
    Includes strings that do not begin with the specified string.
    Example: { "not_begin": "aaa" }.
    end
    String
    Includes strings that end with the specified string.
    Example: { "end": "aaa" }.
    not_end
    String
    Includes strings that do not end with the specified string.
    Example: { "not_end": "aaa" }.
    contain
    String
    Includes strings that contain the specified string.
    Example: { "contain": "aaa" }.
    not_contain
    String
    Includes strings that do not contain the specified string.
    Example: { "not_contain": "aaa" }.
    greater
    String
    Includes strings greater than the specified string.
    Example: { "greater": "aaa" }.
    greater_equal
    String
    Includes strings greater than or equal to the specified string.
    Example: { "greater_equal": "aaa" }.
    less
    String
    Includes strings less than the specified string.
    Example: { "less": "aaa" }.
    less_equal
    String
    Includes strings less than or equal to the specified string.
    Example: { "less_equal": "aaa" }.
    between
    String[]
    Includes strings between the specified strings (including them).
    Example: { "between": ["aaa", "bbb"] }.
    not_between
    String[]
    Includes strings 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
    Includes dates equal to the specified date.
    Example: { "equal": "2018-12-31" }.
    not_equal
    String
    Includes dates not equal to the specified date.
    Example: { "not_equal": "2018-12-31" }.
    before
    String
    Includes dates before the specified date.
    Example: { "before": "2018-12-31" }.
    before_equal
    String
    Includes dates before or equal to the specified date.
    Example: { "before_equal": "2018-12-31" }.
    after
    String
    Includes dates after the specified date.
    Example: { "after": "2018-12-31" }.
    after_equal
    String
    Includes dates after or equal to the specified date.
    Example: { "after_equal": "2018-12-31" }.
    between
    String[]
    Includes dates between the specified dates (including them).
    Example: { "between": ["2018-12-31", "2018-12-31"] }.
    not_between
    String[]
    Includes dates not between the specified dates (excluding them).
    Example: { "not_between": ["2018-12-31", "2018-12-31"] }.
    last
    String
    Includes dates of a previous period. The period can be one of the following: "day", "week", "month", "quarter", "year".
    Example: { "last": "week" }.
    current
    String
    Includes dates of a current period. The period can be one of the following: "day", "week", "month", "quarter", "year".
    Example: { "current": "week" }.
    next
    String
    Includes 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
    Includes time periods equal to the specified time period.
    Example: { "equal": "30m" }.
    not_equal
    String
    Includes time periods not equal to the specified time period.
    Example: { "not_equal": "30m" }.
    greater
    String
    Includes time periods greater than the specified time period.
    Example: { "greater": "30m" }.
    greater_equal
    String
    Includes time periods greater than or equal to the specified time period.
    Example: { "greater_equal": "30m" }.
    less
    String
    Includes time periods less than the specified time period.
    Example: { "less": "30m" }.
    less_equal
    String
    Includes time periods less than or equal to the specified time period.
    Example: { "less_equal": "30m" }.
    between
    String[]
    Includes time periods between the specified time periods (including them).
    Example: { "between": ["30m", "1h"] }.
    not_between
    String[]
    Includes time periods 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: {
              begin: "U",
            },
          },
        },
      ]
    }

    Check out the example on JSFiddle.

    See also

    Filter by condition
    FilterObject
    setFilter()
    clearFilter()