Column Object Members in SuiteAnalytics for NetSuite

Column object members in SuiteAnalytics define dataset fields, enabling dynamic reporting and visualization customization.

·3 min read·View Oracle Docs

TL;DR

The Column Object in SuiteAnalytics provides key members that encapsulate record fields in datasets, crucial for creating and managing analytics tailored for business insights.

What is the Column Object?

The Column Object encapsulates record fields within a dataset in SuiteAnalytics. Columns represent the fields utilized when constructing datasets for analysis and reporting. This functionality allows users to create complex workbooks that visualize data effectively.

Column Object Members

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

Member NameTypeReturn Type / Value TypeSupported Script TypesDescription
Column.aliasstring (read-only)stringServer scriptsThe alias of the column.
Column.fieldIdstring (read-only)stringServer scriptsThe ID of the record field associated with the column.
Column.formulastring (read-only)stringServer scriptsThe formula of the column.
Column.idnumber (read-only)numberServer scriptsThe ID of the column.
Column.joindataset.Join (read-only)dataset.JoinServer scriptsThe join for the column. Used when the column is from a joined record.
Column.labelstring (read-only)stringServer scriptsThe label of the column.
Column.typestring (read-only)stringServer scriptsThe return type of the formula.

How to Create Column Objects

To implement this object effectively, use the dataset.createColumn(options) method. Here’s a brief script demonstrating how to create different types of columns:

suitescript
1// Create a fieldId Column
2var myFieldColumn = dataset.createColumn({
3 fieldId: 'name',
4 id: 7
5});
6
7// Create a formula/type Column
8var myFormulaColumn = dataset.createColumn({
9 formula: '{email}',
10 type: 'STRING',
11 label: 'Formula'
12});
13
14// Create a join Column
15var myJoinColumn = dataset.createColumn({
16 fieldId: 'name',
17 join: myJoin, // Create this using dataset.createJoin
18 alias: 'my joined column'
19});
20
21// Load a dataset and view its Column (in the log)
22var myDataset = dataset.load({
23 id: 'stddataset_mydataset' // Replace with a valid ID value for your account
24});
25var myColumn = myDataset.Column[0];
26
27log.audit({
28 title: 'Column alias = ',
29 details: myColumn.alias
30});
31log.audit({
32 title: 'Column fieldId = ',
33 details: myColumn.fieldId
34});
35log.audit({
36 title: 'Column formula = ',
37 details: myColumn.formula
38});

Who This Affects

This feature is particularly relevant for the following roles:

  • Developers: Building and customizing datasets for analytics.
  • Administrators: Managing data access and structure in SuiteAnalytics.
  • Analysts: Creating visual representations and reports based on dataset queries.

Key Takeaways

  • The Column Object provides essential properties for managing dataset fields in SuiteAnalytics.
  • Each member of the Column Object is read-only and designed for server scripts.
  • Datasets can utilize columns created through precise definitions using the createColumn method.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

How do you create a formula column in SuiteAnalytics?
To create a formula column, use the `dataset.createColumn(options)` method by specifying the formula and type. For example, `formula: '{email}'` and `type: 'STRING'` within the options object.
What is the purpose of the Column.alias member in a dataset.Column object?
The `Column.alias` member provides a read-only string that serves as an alias for the column, which can be used for reference in scripts running on the server.
Can the Column Object members be modified directly in SuiteAnalytics?
No, all members of the Column Object in SuiteAnalytics are read-only, meaning they cannot be modified directly.
What script type supports the Column Object members in SuiteAnalytics?
The Column Object members are supported in server scripts, which are part of SuiteScript 2.0 in NetSuite.
Source: Column Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in SuiteAnalytics

View all SuiteAnalytics articles →