Datasets
Datasets are the basis for all workbook visualizations in your account. You create a query by combining fields from a root record type and any joined related types in a dataset. Your access to record types and fields depends on your account's features and your role's permissions in NetSuite.
For more information about datasets in SuiteAnalytics Workbook, see Defining a Dataset.
You can create a dataset using dataset.create(options). This method creates a dataset.Dataset object. The type
parameter is the only required one, and it sets the root record type for your dataset. For this parameter, you can load the N/query module and use values from the query.Type enum:
var myDataset = dataset.create({
type: query.Type.CUSTOMER
});
Alternatively, if you do not want to load the N/query module, you can use the string equivalents of the query.Type for this parameter:
var myDataset = dataset.create({
type: 'customer'
});
You can also provide these parameters for dataset.create(options):
-
columns
– The columns (fields) in the dataset. Use dataset.createColumn(options) to create columns. For more information, see Columns. -
condition
– A condition (criteria) to be applied to the dataset. Use dataset.createCondition(options) to create conditions. For more information, see Conditions. -
description
– A description for the dataset. Use this parameter only when you are creating a dataset using the Dataset Builder Plug-in. For more information, see Dataset Builder Plug-in. -
id
– A script ID for the dataset. If you do not specify one, an ID is created automatically. Use this parameter only when you are creating a dataset using the Dataset Builder Plug-in. -
name
– A name for the dataset. Use this parameter only when you are creating a dataset using the Dataset Builder Plug-in.
var myDataset = dataset.create({
columns: myColumns,
condition: myCondition,
type: 'customer'
});