Dataset Linking

Note:

The content in this help topic applies to SuiteScript 2.x.

You can link two datasets that have at least one field that shares common data, such as a date. Linking datasets is useful when you are working with record types that cannot be joined.

For more information about dataset linking in SuiteAnalytics Workbook, see Linking Datasets.

To link datasets, use datasetLink.create(options). This method creates a datasetLink.DatasetLink object. As parameters, you must provide an array containing the datasets to link (as dataset.Dataset objects) and an array of expressions representing the columns to use to link the datasets. These columns must contain a common data type, such as string or date. Use Dataset.getExpressionFromColumn(options) to create expressions for columns. For more information, see Expressions. You can also provide an optional ID.

          var myDatasetLink = datasetLink.create({
    datasets: [myFirstDataset, mySecondDataset],
    expressions: [[myFirstColumnExpression, mySecondColumnExpression]],
    id: 'myDatasetLinkId'
}); 

        
Important:

You can use linked datasets only in pivots, not in table views.

For more information, see N/datasetLink Module.

Related Topics

Columns
Conditions
Joins
Datasets

General Notices