- 1 Minute to read
- Print
- DarkLight
- PDF
Fields from Values
- 1 Minute to read
- Print
- DarkLight
- PDF
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.
- 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
Creating datasets from values
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"
}