Condition Group

This JSON represents a complex filtering condition with multiple sub-conditions and logical connectors for querying a dataset. The main condition includes:

  • Sort: A sorting priority of 1 for this main condition.

  • Connector: The logical connector "And" implies that all conditions within this group must be satisfied.

  • Conditions: Three individual conditions within this group:

    1. Filter by "Price" greater than 10 (Numeric condition).

    2. Filter by "Category" equal to "Electronics" (Text condition).

    3. Filter by "InStock" equal to "true" (Boolean condition).

Additionally, there are two sub-condition groups, each with its own connector and conditions:

  1. Sub-Condition Group 1:

    • Connector: The logical connector "Or" implies that at least one condition within this group must be satisfied.

    • Conditions: Two conditions:

      • Filter by "Discount" greater than 20 (Numeric condition).

      • Filter by "Brand" equal to "Sony" (Text condition).

  2. Sub-Condition Group 2:

    • Connector: The logical connector "And" implies that all conditions within this group must be satisfied.

    • Conditions: Two conditions:

      • Filter by "ShippingDate" greater than "2023-01-01" (Date condition).

      • Filter by "ShippingDate" less than or equal to "2023-12-31" (Date condition).

{
  "Sort": 1,
  "Connector": "And",
  "Conditions": [
    {
      "Sort": 1,
      "Field": "Price",
      "DataType": "Number",
      "Operator": "GreaterThan",
      "Values": ["10"]
    },
    {
      "Sort": 2,
      "Field": "Category",
      "DataType": "Text",
      "Operator": "Equal",
      "Values": ["Electronics"]
    },
    {
      "Sort": 3,
      "Field": "InStock",
      "DataType": "Boolean",
      "Operator": "Equal",
      "Values": ["true"]
    }
  ],
  "SubConditionGroups": [
    {
      "Sort": 1,
      "Connector": "Or",
      "Conditions": [
        {
          "Sort": 1,
          "Field": "Discount",
          "DataType": "Number",
          "Operator": "GreaterThan",
          "Values": ["20"]
        },
        {
          "Sort": 2,
          "Field": "Brand",
          "DataType": "Text",
          "Operator": "Equal",
          "Values": ["Sony"]
        }
      ],
      "SubConditionGroups": []
    },
    {
      "Sort": 2,
      "Connector": "And",
      "Conditions": [
        {
          "Sort": 1,
          "Field": "ShippingDate",
          "DataType": "DateTime",
          "Operator": "GreaterThan",
          "Values": ["2023-01-01"]
        },
        {
          "Sort": 2,
          "Field": "ShippingDate",
          "DataType": "DateTime",
          "Operator": "LessThanOrEqual",
          "Values": ["2023-12-31"]
        }
      ],
      "SubConditionGroups": []
    }
  ]
}

Last updated