N/dataset Module

Use the N/dataset module to create a new dataset, load an existing dataset, list all existing datasets, or save a dataset. This module is available in server scripts only.

                                   

You can also use this module to:

Datasets are the basis for all workbooks and workbook components in your account. In a dataset, you combine record type fields and criteria filters to create a query. The results of this query can be used as the source data for the workbooks you create in your account. A single dataset can be used in multiple workbooks. For more information about datasets in SuiteAnalytics, see Defining a Dataset. For more information about workbooks, see N/workbook Module.

In This Help Topic

N/dataset Module Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Object

dataset.Column

Object

Server scripts

A column in the dataset, which usually represents a record field.

dataset.Condition

Object

Server scripts

A condition or set of conditions to apply to a column.

dataset.Dataset

Object

Server scripts

A representation of the entire dataset, including columns, conditions, and joins.

dataset.Join

Object

Server scripts

A joined record used in the dataset.

Method

dataset.create(options)

dataset.Dataset

Server scripts

Creates a dataset.

dataset.createColumn(options)

dataset.Column

Server scripts

Creates a dataset column.

dataset.createCondition(options)

dataset.Condition

Server scripts

Creates a dataset condition (criteria). A condition is applied to a dataset column and includes an operator.

dataset.createJoin(options)

dataset.Join

Server scripts

Creates a dataset join.

dataset.createTranslation(options)

workbook.Expression

Server scripts

Creates a translation expression based on a Translation Collection.

dataset.describe(options)

Object[]

Server scripts

Retrieves descriptive information about a dataset, including name, description, and a list of columns or formulas with their labels and types.

dataset.list()

Object[]

Server scripts

Lists all existing datasets.

dataset.listPaged(options)

PagedInfoData

Server scripts

Returns metadata about datasets as a set of paged results.

dataset.load(options)

dataset.Dataset

Server scripts

Loads an existing dataset.

Column Object Members

This object encapsulates the record fields in the dataset. Columns are equivalent to the fields you use when you build a dataset in SuiteAnalytics. For more information about datasets in SuiteAnalytics, see Custom Workbooks and Datasets.

The following members are available for a dataset.Column object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Column.alias

string (read-only)

Server scripts

The alias of the column.

Column.fieldId

string (read-only)

Server scripts

The ID of the record field associated with the column.

Column.formula

string (read-only)

Server scripts

The formula of the column.

Column.id

number (read-only)

Server Scripts

The ID of the column.

Column.join

dataset.Join (read-only)

Server scripts

The join for the column. Used only when the column is from a joined record.

Column.label

string (read-only)

Server scripts

The label of the column.

Column.type

string (read-only)

Server scripts

The return type of the formula.

Condition Object Members

This object encapsulates the criteria in the dataset. Conditions are equivalent to the criteria you use when you build a dataset in SuiteAnalytics. For more information about criteria used in datasets in SuiteAnalytics, see Dataset Criteria Filters.

The following members are available for a dataset.Condition object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Condition.children

dataset.Condition[] (read-only)

Server scripts

The children of the condition (for example, subconditions AND’d or OR’d).

Condition.column

dataset.Column (read-only)

Server scripts

The column on which the condition is placed.

Condition.operator

string (read-only)

Server scripts

The operator of the condition.

Condition.values

string[] | number[] | boolean[] | Date[] | Object[] (read-only)

Server scripts

The values for the condition.

Dataset Object Members

This object encapsulates the entire dataset. For more information about datasets in SuiteAnalytics, see Custom Workbooks and Datasets.

The following members are available for a dataset.Dataset object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Method

Dataset.getExpressionFromColumn(options)

workbook.Expression

Server scripts

Returns an expression which can be used in a workbook.

Dataset.run()

query.ResultSet

Server scripts

Executes the dataset and returns the result set (the same as in N/query Module).

Dataset.runPaged()

query.PagedData

Server scripts

Executes the dataset and returns the result set in paginated data form (the same as in N/query Module).

Dataset.save(options)

Object

Server scripts

Saves a dataset.

Property

Dataset.columns

dataset.Column[]

Server scripts

The columns in the dataset.

Dataset.condition

dataset.Condition

Server scripts

The condition (criteria) for the entire dataset.

Dataset.description

string

Server scripts

The description of the dataset.

Dataset.id

string

Server scripts

The ID of the dataset.

Dataset.name

string

Server scripts

The name of the dataset.

Dataset.type

string

Server scripts

The internal ID for the base record type for the dataset.

Join Object Members

Encapsulates a joined record used in the dataset. For more information about using joins in a dataset, see Joining Record Types in a Dataset.

The following members are available for a dataset.Join object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Join.fieldId

string (read-only)

Server scripts

The ID of the field on which the join is performed.

Join.join

dataset.Join (read-only)

Server scripts

The child join, if the join is a multilevel join.

Join.source

string (read-only)

Server scripts

The internal ID for the source record type of the join.

Join.target

string (read-only)

Server scripts

The polymorphic target of the join.

Related Topics

N/workbook Module
Custom Workbooks and Datasets
Defining a Dataset
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices