Function Overview
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Function Overview

  • Dark
    Light
  • PDF

Article summary

Function fields - also known as "BakedFields" - are inbuilt DataJet functions that can be applied to existing data fields in order rapidly create new fields.  Along with Expressions, DataSetFields and User-Defined Fields they play a key role in the transformation of data.

See Baked Fields for an overview of Baked Fields

Find Function

Accessed via Engineering | Functions | Find Function

The Find Function dialog allows functions to be searched for via keywords: 

It is also possible to filter results by function group.

Double-click a function to bring up the function selector.


Function Selector

Accessed via Engineering | Functions | Selector

The Function Selector Dialog first requires either a function group, or a general function to be selected.

(Click the search icon to bring up the function search dialog)

Select a function/group and sub function

  • Enter table that that field is to be created on
  • Apply a filter of records to be included when building the new field (optional - if not provide, all records in the source table will be included)
  • Enter parameters 
  • Specify a name for the new field
  • Click Build


Parameters

Parameters can be of two types:

  • fields
  • fixed values

fixed values must be prefixed by the pound sign (#):

Methods for Adding Parameters
Parameters can be added to the function dialog in the following ways:
  • Drag and drop from the Database Explorer
  • Type the parameter name or value
  • Select the required field in the Database Explorer, press  CTRL C to copy the field name to clipboard, and then do CTRL V to paste into the fnuction dialog
  • Select the required field from the drop down 

Do Not Ordinalize

If available and checked, this will force the field to be created as a continuous field.  Note this added the "flags": "NOORD" key to the executed JSON:

{
  "method": "BuildBakedField",
  "project": "Election5",
  "targetTable": "PA_All",
  "overwrite": true,
  "name": "NoOrd",
  "function": "string",
  "p1": "CONCAT(A,B,C,D,E,F)",
  "p2": "geo_id",
  "p3": "#_",
  "p4": "locality_fips",
  "flags": "NOORD"
}

Properties

To see the JSON that was used to create a BakedField, select the field in the Database Explorer, right-click and choose Properties:


Existing Fields

Using an existing field as a template
To create a copy of an existing field, select it in the Project Explorer, right-click and choose Edit - the function dialog will be opened with the parameters for the existing field. Change the function name to be the name of the new field, click build, and a copy of the field will be created.
Existing Fields
If a field of the specified name already exists, an overwrite prompt will be displayed.   Choosing to overwrite will permanently change the existing field content.    If a field is written over by mistake, access the Project History to retrieve the earlier version.


Functions

The following function groups are available on the function menu:

  • General - general functions, including key creation, discrete value processing, access to indexes, joinlayer functions and quantiles.
  • DateTimeTransform - transformations involving hours, minutes and seconds
  • DateTransform - transformations involving years, months and days
  • DMath - transformations producing decimal fields
  • LMath transformations that produce integer fields
  • FLogic - logical functions that evaluate conditions and produce flag fields
  • Geo - geographical functions, including distance calculations
  • Statistical - distributions and transformation that support data modelling and cleaning
  • String - transformations of string data
  • UserAgent - extractions of web data


The function menu can be accessed via:




Was this article helpful?