Create columns
Columns represent the record fields that are included in the dataset. Column definitions are used to create conditions that apply to the corresponding fields in the dataset.
In this step, you will create objects to represent columns for the dataset.
-
In your script file, create a column using dataset.createColumn(options). This column represents the
entityid
field on the root customer record type. Add the following code after the two dataset.createJoin(options) calls in Create joins with other record types:var entityIdColumn = dataset.createColumn({ fieldId: 'entityid' });
The dataset.createColumn(options) method returns a dataset.Column object.
-
Create a second column to represent the
email
field on the joined employee record type. Add the following code after the first dataset.createColumn(options) call:var emailColumn = dataset.createColumn({ fieldId: 'entityid', join: salesRepJoin });
-
Create a third column to represent the
trandate
field (transaction date) on the joined transaction record type. Add the following code after the second dataset.createColumn(options) call:var trandateColumn = dataset.createColumn({ fieldId: 'trandate', join: transactionJoin });
At this point, your script file should look similar to the following:
require(['N/dataset'], function(dataset) {
var tutorialDataset = dataset.create({
type: 'customer'
});
var salesRepJoin = dataset.createJoin({
fieldId: 'salesrep'
});
var transactionJoin = dataset.createJoin({
fieldId: 'entity',
source: 'transaction'
});
var entityIdColumn = dataset.createColumn({
fieldId: 'entityid'
});
var emailColumn = dataset.createColumn({
fieldId: 'entityid',
join: salesRepJoin
});
var trandateColumn = dataset.createColumn({
fieldId: 'trandate',
join: transactionJoin
});
});
SuiteAnalytics Workbook UI
In the SuiteAnalytics Workbook UI, each included column (field) is highlighted at the top of the Fields list. You can also see each field as a column heading in the Data Grid.

Previous: Create joins with other record types |
Next: Create conditions |