Managing SuiteQL Queries in Profitability and Cost Management Sync
You can write SuiteQL queries to load transaction data and metadata from NetSuite into your Profitability and Cost Management application.
The SuiteQL query results don't include metadata hierarchy.
To define a SuiteQL query:
-
In NetSuite, go to NetSuite EPM > Profitability and Cost Management > Manage SuiteQL Queries.
-
On the Manage SuiteQL Queries page, do one of the following:
-
To create a new SuiteQL query, click Add SuiteQL Query.
-
To update an existing SuiteQL query, click Edit next to the query.
-
-
In the ID field, enter a unique ID for the SuiteQL query you are creating.
Important:The integration recognizes IDs the prefixes of which begin with
custsql_. If you omit this prefix,custsql_is automatically prepended. -
In the Name field, enter a unique name for the SuiteQL query you are creating.
-
In the Result Column Labels field, enter the names of your SuiteQL query result columns, separated by commas.
Important:Make sure you don't enter line breaks when entering the column names.
Tip:To populate the field with the column names you defined in the query, click Populate Result Column Labels. For details, see Step 7 below.
-
In the Query field, provide the query details.
Review the following guidelines for adding filters to SuiteQL queries:
-
Add only the filters you want to make available in Data Exchange.
-
To filter values using the '@' symbol, keep the following in mind:
-
You can use the '@' symbol to specify parameter placeholders for filters. For example, see the following query where a date is used as a filter:
select top 10 memo from transaction where createddate > to_date(@datecreatedfilter@, 'DD-MM-YYYY');When you use this query, ensure that the value you provide for
datecreatedfiltermatches the date format specified in theto_datefunction. Here are some examples:-
If your date value is '31-07-2020', the query should be:
select top 10 memo from transaction where createddate > to_date('31-07-2020', 'DD-MM-YYYY'); -
If your date and time value is '2015/05/15 8:30:25', the query should be:
select top 10 memo from transaction where createddate > to_date('2015/05/15 8:30:25', 'YYYY/MM/DD HH:MI:SS');
-
-
Using the '@' symbol to separate values in
INclauses is not supported.
Note:The filter placeholders become available in Data Exchange. These placeholders don't have default values. You should set their values during Data Integration execution.
-
-
-
To populate the Result Column Labels field with the column names you defined in the query, click Populate Result Column Labels.
If you use this option, follow these guidelines:
-
Replace filter placeholders with specific values before using this action.
-
If this action overwrites existing column labels, confirm the action when prompted.
-
-
Click Save.
-
To ensure the integration recognizes the created SuiteQL query, place the
custsql_prefix on the Profitability and Cost Management allowlist. For instructions, see Data Source Allowlist.
For general information about SuiteQL, see SuiteQL.
Related Topics
- Profitability and Cost Management Sync Installation and Setup
- Role Permissions for Profitability and Cost Management Sync Users
- Profitability and Cost Management Sync Configuration Checklist
- Saved Searches for Profitability and Cost Management Sync
- Managing the Profitability and Cost Management Sync Saved Searches
- Saved Search Settings in Profitability and Cost Management Sync
- Using SuiteAnalytics Datasets with Profitability and Cost Management Sync
- Managing Jobs in Profitability and Cost Management Sync
- Portlets for Profitability and Cost Management Sync