Joins
Joins help you add fields from other record types to your dataset. You can join multiple record types, even if they're not directly related to the main record type, using multilevel joining.
For more information about joining record types in SuiteAnalytics Workbook, see Joining Record Types in a Dataset.
You can create a join using dataset.createJoin(options). This method creates a dataset.Join object. You can create a join using the following combinations of parameters:
-
fieldId
– The field to use for the join. This type of join automatically infers the source and target record types for the join based on the record structure.var myJoin = dataset.createJoin({ fieldId: 'email' });
-
fieldId
andjoin
– The field to use and an existing join. This type of join is a multilevel join. Use the join parameter only if a child join exists with the current join as its parent.var myJoin = dataset.createJoin({ fieldId: 'phone', join: myExistingJoin });
-
fieldId
and eithersource
ortarget
– The field to use and the join direction. You might need to specify the source or target if the system can't automatically determine them based on the record structure. For example, use thetarget
parameter if you are joining to a record type that could define multiple inherited record types (such as entity records).var myTargetJoin = dataset.createJoin({ fieldId: 'phone', target: 'entity' });
var mySourceJoin = dataset.createJoin({ fieldId: 'phone', source: 'contact' });