Use query parameters in your API requests to filter or sort when you retrieve data from the server.
One or more query parameters can be added to the end of a request, to manage the volume and form of the data returned for that resource. A query parameter requests that a service run a series of transformations, such as filtering or sorting, on its data before delivering the response. You can further combine these parameters with logical operators to refine your request.
System query options are query string parameters that control the amount and order of the data returned for the resource identified by the URL. The names of all system query options are optionally prefixed with a dollar ($) character.
For example, GET https://fluenceapi-prod.fluence.app/api/CustomerTenant/{API_Token}/v2305.1/odata/Consolidation?$select=Account_Name,Entity_Name,CostCenter_Name,Currency_Name,Scenario_Name,Date_Name,Amount&$filter=filter=(Entity_Name eq '120') and (Date_Name eq '2024 Dec') and ('Scenario_Name eq 'Actual')
This example retrieves records for Entity_Name '120', Date_Name '2024 Dec', Scenario_Name 'Actual' with the specific columns:
Account_Name
Entity_Name
CostCenter_Name
Currency_Name
Scenario_Name
Date_Name
Amount
Apply ($apply) and groupby ($groupby)
Use the $apply
system query option to carry out transformation, grouping, and aggregation tasks on the data.
The groupby
option groups rows of a column with the same stored value, based on a specified function in the statement. Typically, these functions are one of the standard aggregation methods, for example: min, max, sum, and average.
$apply=groupby((Field))
groups data by one or more fields.aggregate(...)
performs calculations (sum, count, etc.) on grouped data. Combine them to optimize API queries for performance and efficiency.
For example, GET https://fluenceapi-prod.fluence.app/api/CustomerTenant/{API_Token}/v2305.1/odata/Consolidation?$apply=groupby((Account),aggregate(Amount+with+sum+as+Total))
This request groups all Account
dimensions within the Consolidation
client schema table, and calculates the total Amount
for the specified account.
Note: for a better understanding of OData aggregation functionality, please see the OData documentation.
Count ($count)
The $count
system query option allows clients to request a count of the matching resources included with the resources in the response.
For example, GET https://fluenceapi-prod.fluence.app/api/CustomerTenant/{API_Token}/v2305.1/odata/Consolidation?Filter=(Entity_Name eq '120')&$apply=groupby((Entity_Name),aggregate($count as Count))
This example retrieves and counts the number of records within the Consolidation
client schema table for Entity_Name '120'
.
Filter ($filter)
Use the $filter
system query option to filter a collection of data addressed by a request URL. The system evaluates the specified expression with the $filter for each row in the table. Only items that evaluate the expression to be true are included in the response.
For example, GET https://fluenceapi-prod.fluence.app/api/CustomerTenant/{API_Token}/v2305.1/odata/Consolidation?Filter=(Entity_Name eq '120') and (Date_Name eq '2024 Dec') and (Scenario_Name eq 'Actual')
This example retrieves records within the Consolidation
client schema table for a specific Entity_Name, '120', date, '2024 Dec', and Scenario_Name, 'Actual'.
Order by ($orderby)
Use the $orderby
option to specify the order you want to request resources. When using the $orderby
parameter, use 'asc' for ascending and 'desc' for descending.
For example, GET https://fluenceapi-prod.fluence.app/api/v2305.1/odata/Consolidation?$orderby= Amount desc
This example retrieves the records within the Consolidation
client schema table and returns the results in descending order based on the Amount
field.
Page (Page) and PageSize (PageSize)
Batch requests support server-side paging, allowing you to set the query page and the number of rows to retrieve for each page. The maximum paging size is 2500 rows. For the Page
field, you can specify the desired query page to retrieve, while the PageSize
field in the query specifies how many rows to fetch for that page. The $Skip
parameter in the query string determines the starting point for rows in server-side paging.
The Page
parameter starts at 1.
Furthermore, the count of dimension members is also returned.
The TotalRows
field, present in the response body, holds the overall row count for the dimension within the system. Similarly, the CurrentPage
field in response bodies indicates the current page, and TotalPages
represents the total number of pages.
To control the presentation, you can use the Format header key/value. Setting it to flat results in a flattened list of dimension members and property fields. If no format is specified, the default value default is applied. Using the default format, the members and properties are presented in a nested array.
For example, GET https://fluenceapi-prod.fluence.app/api/CustomerTenant/{API_Token}/v2305.1/metadata/Dimensions/Measure?Page=1&PageSize=500
This example retrieves a list of members for the Measure dimension. Query parameters, Page and PageSize returns the first page of data containing up to 500 rows.
Select ($select)
The $select
system query option retrieves a specific set of columns from the client schema table. Your Anaplan Financial Consolidation system may contain large financial data with multiple rows associated with the client schema. By using the $select parameter, businesses can specify a subset of fields they need in the API response. This reduces network bandwidth and improves performance by retrieving only the required data.
The value of $select is a comma-separated list of selected items. Each select item is one of:
- a wildcard character, the asterisk (
*
), to include all declared or dynamic columns. - a path to include a column name.
For example, GET https://fluenceapi-prod.fluence.app/api/CustomerTenant/{API_Token}/v2305.1/odata/Consolidation?$select *
This example retrieves all columns and rows by using the $select *
from the Consolidation
client schema table.
To limit the records, you can use, for example, GET https://fluenceapi-prod.fluence.app/api/CustomerTenant/{API_Token}/v2305.1/odata/Consolidation?$select=Account_Name,Entity_Name,CostCenter_Name,Currency_Name,Scenario_Name,Date_Name,Amount
This example retrieves all the columns and rows within the Consolidation
client schema table containing:
Account_Name
Entity_Name
CostCenter_Name
Currency_Name
Scenario_Name
Date_Name
Amount
Skip ($skip)
The $skip query option instructs the query to exclude a specified number of items from the collection in the result.
For example, GET https://fluenceapi-prod.fluence.app/api/CustomerTenant/{API_Token}/v2305.1/odata/Consolidation?$skip=10
This example excludes the first 10
rows from the Consolidation
client schema table.
Top ($top)
The $top system query option instructs the query to include a specified number of items from the collection in the result.
GET https://fluenceapi-prod.fluence.app/api/CustomerTenant/{API_Token}/v2305.1/odata/Consolidation?$top=10
This example includes the first 10
rows within the Consolidation
client schema table.