A+B (LMATH)
  • 1 Minute to read
  • Dark
    Light
  • PDF

A+B (LMATH)

  • Dark
    Light
  • PDF

Article summary

LMath: A+B

Adds the value of integer portion of Input A to the value of integer portion of Input B

Purpose

Use this function to:
  • Sum numeric data
  • Add values from numeric columns together
  • Increment a column by a fixed value

Return Value

PropertyValue
FieldTypeInteger
FieldSizeLow / Med / High / Continuous
DataTypeDiscrete / Continuous
DataSizeShort / Integer 
Example Return Value: X*...-X*

e.g.  21, 98754654, -5, -654

AplusB_Sample


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”: “A+B”A+B
A“p2”: “NumericFieldName”
“p2”: “#N*.N*”
“p3”: “#-N*.N*”
Required. 
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
B“p3”: “NumericFieldName”
“p3”: “#N*.N*”
“p3”: “#-N*.N*”
Required. 
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.

JSON Sample

{
  "method": "BuildBakedField",
  "project": "Model1",
  "targetTable": "WHOLESALE",
  "overwrite": true,
  "name": "Fresh n Milk",
  "function": "lmath",
  "p1": "A+B",
  "p2": "Fresh",
  "p3": "Milk"
}


Usage Notes

Adding together 2 decimals using A+B(LMATH) adds together just the integer portions of the decimal number:

AplusB_Usage

See Also:   

Example

ExampleDetails
DescriptionAdd two numeric fields together
Input
  • Table: = [wholesale]
  • Filter:= [No Filter]
  • Function: = LMath
  • Math Function = A+B
  • A:= [wholesale ].[fresh]
  • B:= [wholesale].[milk]
  • Name: = fresh n milk
SampleAplusB_Example






Was this article helpful?

What's Next