Fields from Values
  • 1 Minute to read
  • Dark
    Light
  • PDF

Fields from Values

  • Dark
    Light
  • PDF

Article summary

Overview

Create multiple flag fields from multiple discrete values of a given field.

Setup

  • Select source table then field
  • Or drop a field onto the fields combo
  • Or drop a field onto the grid


The grid will fill with the unique values of that field. 

Unwanted values can be deleted by selecting them and hitting Delete Value or Right->Click->Delete Selected.

The grid will fill with a suggested name for each field, based on the unique value. This can be edited.

Optionally,  a universal filter can be applied.

Select a target table for the flag fields, this can be left empty if same as the source field's table.

The new fields will be created on both tables if  Add To Both Tables is checked

Tips:

For discrete fields, when only a small percentage of values are required, drag and drop a field on the empty grid, this will invoke the value selector tool:

This gives control over the values initially added to the grid. 

The same field can be dragged onto the grid again to append further values if required.

Cardinality and field selector display
The discrete value selector will only display if:
  • field is a string with less than 250 discrete values
  • field is a numeric with less than 50 discrete values

External Editing

Use the grid's context menu to copy data for pasting into an external editor.

Once edited the results can be pasted back by right clicking on the grid and selecting Paste New Definition.


Creating fields from values

Create new Dataset fields from Field Values

 



Creating datasets from values

Create as datasets

 


Example JSON

The following JSON creates new dataset fields from selected field values

{
  "method": "FieldsFromValues",
  "overwrite": true,
  "bothTables": false,
  "asDataSets": false,
  "field": "worldcities.capital",
  "values": [
    "null",
    "admin",
    "minor",
    "primary"
  ],
  "names": [
    "capital_null",
    "capital_admin",
    "capital_minor",
    "capital_primary"
  ],
  "project": "BikeData3"
}

Was this article helpful?