Functions, field names and variables - 3.12

Data360 Analyze Server Help

Data360 Analyze
Product family
Product name
Data360 Analyze
Data360 Analyze Server Help
First publish date
This topic relates to Data360 Analyze Script which is the language that is used in some superseded nodes. If you are looking for help configuring the Python-based nodes, please see Python scripting.

What is a function?

A function is a pre-built instruction that performs an operation and returns a value. The following syntax is used with functions:

function(parameter1, parameter2...)

Or, the first parameter can also be specified as follows:


Function names are written in lowerCamelCase, that is, the first word is written in lower case and subsequent words have the first letter capitalized (for example, toDate or deleteFile).

Double quotes or single quotes?

  • Use single quotes to refer to field names.

If the field name that you are referencing contains any spaces, or starts with a number, the field name must be written inside single quotes.

• fieldName # Does not need to be enclosed within single quotes because the field name does not contain any spaces and starts with a letter.• 'field Name' # Must be enclosed within single quotes because the field name contains a space.• '1fieldName' # Must be enclosed within single quotes because the field name starts with a number.

  • Use double quotes to indicate literal text (not a field).

emit *where type == "Direct Debit"

How do I define a variable?

A variable is a container that holds information.

Variables are defined by stating a name and what information they should contain. Variable names are specified in the following format, where the variable name is written on the left and the expression that identifies the information that it contains is written on the right:

<variable name> = <expression>

After a variable has been defined, it can then be referenced in an emit statement. Variables are useful when you are dealing with numerous edits as they can help to keep the coding cleaner and easier to read.

Note: A variable name must begin with a letter or underscore and can only contain alphanumeric characters and underscores.

1. Variable "orderMore" is defined. This statement must be placed before the emit statement:

orderMore = if UnitsInStock + UnitsOnOrder < Desired then "Yes" else "No"

2. Variable is referenced in an emit statement:

emit *, orderMore

In this example, "orderMore" will be included as a new column in the output.

Tip: Do not confuse the assignment operator (=) with the equality operator (==).While = assigns a value, == checks if two things are equal.