QQ - How do I dynamically create a banded field in script?
  • 1 Minute to read
  • Dark
    Light
  • PDF

QQ - How do I dynamically create a banded field in script?

  • Dark
    Light
  • PDF

Article summary

Banded fields group numeric data into "bins" that have specified upper and lower limits.   Various options are available for controlling banding through the Banded Field dialog.   

To create the kind of banded field that will dynamically calculate bins depending on the source data, use the Engineering | Banded Fields | Auto option.

This will bring up the Auto Banded Field dialog:


The following is an example of a JSON method used to create an Auto-banded field:

{
  "method": "BuildBakedField",
  "project": "DemoPrep6",
  "targetTable": "03_HEADER",
  "p1": "phone_no",
  "overwrite": true,
  "name": "phone_no_banded",
  "auto": true,
  "bands": 10,
  "named": true,
  "function": "numberband",
  "dataSet": {
    "logic": "or",
    "name": "state_AK",
    "strict": true,
    "set": [
      {
        "logic": "and",
        "stype": "FIELD",
        "entity": {
          "type": "field",
          "name": "03_HEADER.state",
          "table": "03_HEADER",
          "valueFilter": []
        },
        "op": "=",
        "values": [
          "AK"
        ]
      }
    ]
  }
}



KeyValueDescription
methodBuildBakedField

project

targettable
table containing source field
p1
field name
overwritetrue, falseif true, field will be recreated
name
banded field name
dataSet
Filter of records to include in banding
functionnumberband

bands1...128number of "bins" or bands to create
namedtrue, falseif true, band names will be automatically calculated
autotrue, falseIf true, band intervals will be automatically calculated to fit the specified number of bands



Was this article helpful?