SI.QUERY
Overview
If you want to get the data from your Intacct instance into your workbook, you can use the SI.QUERY function, which returns the contents of the specified Sage object (as either an Excel array or - optionally - as an Excel table).
You can use the Query feature in Velixo NX to build SI.QUERY formulas interactively. See the dedicated article
Syntax
=SI.QUERY(ConnectionName, Object, Filter, Select, IncludeHeader, Settings, OutputColumn1, OutputColumn2, ... OutputColumnN)
Arguments
Argument | Required/Optional | Description |
| Required | The name of the connection, as specified in the Connection Manager |
| Required | Sage Intacct object name (e.g.,
CODE
Use the SI.EXPANDOBJECTRANGE function to get the list of Sage Intacct objects. Although listed as a valid object, Sage Intact does not support querying the GLRESTRICTIONRELEASE object. |
| Optional | SQL-like query based on fields on the object. The following operators are supported: |
| Optional | Comma-separated list of columns to be included in the resulting dataset. If this argument is empty, all the columns from the object will be returned.
|
| Optional |
|
| Optional | You can either enter a number to set how many rows you want or use a list of settings (key-value pairs) to specify advanced query settings.
Example:
CODE
|
| Optional | Optionally, specifies the cell on the worksheet where the data of the first column specified in the Select argument is to be displayed as part of an Excel table. |
| Optional | Specifies the cell of the worksheet where the data of the second column specified in the Select argument is to be displayed as part of an Excel table. |
... | ||
| Optional | Specifies the cell of the worksheet where the data of the Nth column specified in the Select argument is to be displayed as part of an Excel table. |
Excel Online
Loading large datasets with SI.QUERY()
is not performant in Excel Online due to the limitations of the Excel platform in the browser. If your dataset contains more than approximately 100,000 records, we strongly recommend using a desktop version of Excel 365 for Windows or Mac OS.
Querying subtypes of objects
The SI.QUERY function can retrieve data for specific subtypes of objects in Sage Intacct. This is particularly useful for template objects with multiple variations, such as:
SODOCUMENT (Contract Change Order, Project Contract Invoice)
PODOCUMENT (Purchase Order, Subcontract Invoice)
INVDOCUMENT (Adjustment Decrease, Inventory Receipt)
Examples
First 10 records
=SI.QUERY("Sage","GLBatch",,,,10)
Description:
Returns the top 10 records returned by the GLBatch
object (after any filtering is applied).
Result:

Filter example 1
=SI.QUERY("Sage","TaxSolution", "TaxMethod='VAT or GST'", "SolutionID,TaxMethod")
Description:
Returns the SolutionID and TaxMethod fields from the TaxSolution object where the TaxMethod field is set to VAT or GST:
Result:

Filter example 2
=SI.QUERY("Sage","TaxDetail","DESCRIPTION LIKE('%Sales%')", "RecordNo,DetailID,Description,TaxType,Value,Include, GLAccount,TaxAuthority,Status")
Description:
Returns the specified fields (in the order specified) from the TaxDetail object where the Description field contains the case-sensitive substring Sales
Result:

Include columns from related objects
=SI.QUERY("Sage", "Project", (PROJECTID='22-002'), "PROJECTID,NAME,MANAGER.EMPLOYEEPOSITION.NAME")
Description:
This SI.QUERY example queries the PROJECT object and returns 3 columns for a single, specified ProjectID.
The third specified field (NAME) originates from the EMPLOYEEPOSITION object that is related to the MANAGER object which is then related to the PROJECT object (demonstrating multi-level "lookups").

The above formula is equivalent to the formula in the screenshot, demonstrating the use of cell references for function arguments.
The query automatically understands which relationships to use when specifying prefixed column names with related object names.
Here are the relationships of the related objects for the above example:
From the PROJECT object, the Employee relationship relates to object: MANAGER

From the MANAGER object: the Employee position relationship relates to the EMPLOYEEPOSITION object

The field NAME is then used from the EMPLOYEEPOSITION Object to return the name of the Employee Position

Send output to an Excel table
This and other examples of creating Excel tables can be found in Table Mirroring.
=SI.QUERY("Sage","Project",,"RECORDNO,PROJECTID,PROJECTTYPE,NAME",TRUE,,A5,B5,D5,C5)
Description:
Instead of displaying the results of the query starting in the cell containing the SI.QUERY function, the function Cell A2 displays the specified fields from the Project object in an Excel data table located in the cells specified by the OutputColumns
arguments (cells A5, B5, D5, and C5)

Aggregation examples
The Velixo SI.QUERY function also supports the ability to perform aggregation of data.