DMath Overview
  • 1 Minute to read
  • Dark
    Light
  • PDF

DMath Overview

  • Dark
    Light
  • PDF

Article summary

DMATH Functions

Functions that work on numeric fields and create fields with decimal precision

Purpose

Use DMATH functions to:
  • Perform efficient mathematical manipulations on numeric data
  • Perform floating point math functions

Return Value

PropertyValueNotes
FieldTypeDoubleDMath functions always return a double (decimal) field type with 6 figure precision
FieldSizeMed / High / ContinuousMed - Up to 65,630 unique values
High  - up to 1,000,000 unique values
Continuous - greater than 1,000,000 unique values
DataTypeDiscrete / ContinuousDiscrete, unless number of unique values > 1,000,000
DataSizeShort / Integer / DoubleShort - Up to 65,630 unique values
Integer  - up to 1,000,000 unique values
Double - greater than 1,000,000 unique values
Example Return Value: 
-n*.nnnnnn....n*.nnnnnn

e.g. -509.000000......90876.123456
Displaying DataType[Double]
  • Fields of DataType Double (decimals/floating points) will be displayed in the data view without decimals if all decimal values are .000000
  • Decimal precision is always displayed in the Quick Profiler
Dividing by zero
  • Dividing by zero will produce a null

Parameters

Data View
Various "Double" Data fields displayed in data View

Quick Profiler and Tree view

 


Parameters

ParameterJSONDescription
Table“targetTable”: “MyTableName”The target table on which the new field will be created
Filter“dataset”: {DataSet_JSON}Optional.   If a filter is applied, records not in the filter recordset will be returned as null.
Math Function“p1”: “”Select the DMATH function from the drop-down list.
Specifies the function to use.
A - F
“p2-6”: “NumericFieldName”
“p2-6”: “#N*.N*”
Fields to use for the values A-F.   Alternatively, a field can be replaced with a Fixed Value.  Fixed values must be preceded by the hash symbol (#).
Supports:  
  • DataType: Discrete / Continuous
  • Field Type: Integer, Double
  • Fixed Value:  #N*    e.g. #201596,    #-87
  • Fixed Value: #N*.N* e.g. #201596.05,    #-87.98
Treat Null as Zero"nullIsZero": true
"nullIsZero": false

True/False.
Default = False
If true, then any null values in the input fields will be treated as if they have a value of 0.

If any of the source fields contain a null the result will be null, unless “Treat Null As Zero” is selected, in which case all field values of null will be assumed to be zero.

Name"name" : "FieldName"Required.   The name of the field to create.  

JSON Sample


Usage Notes

DMath manipulations that are not covered through built in DMath functions (baked fields) may still be achievable using Mathematical Expression fields.    

Mathematical Expression Fields
  • Flexible
  • May be slower to process than DMath functions
  • If calculation time on an expression field is an issue, and a corresponding DMath function is available, considering switching to DMath

See Also:   




Was this article helpful?

What's Next