Examples
Examples
In this article, we compile all the examples throughout the documentation. For generating API requests in your programming language, please refer to the interactive API Reference.
Open API specification
Python scripts
Please view our various Recipes to see examples of our API in action, written in Python.
Intersections API filters parameter
By filter expression
Filter Expression | Member selection logic | Example |
---|---|---|
“eq”: “bottom_level_member” | Selects a single bottom-level member in a dimension Required input: a single bottom-level member | { "field": "Account", "eq": "Revenue" } |
“in”: [bottom_level_member_1, bottom_level_member_2, bottom_level_member_3...] | Selects multiple bottom-level members in a dimension Required input: an array of bottom-level members | { "field": "Year", "in": ["2020", "2021"] } "mx": {"bottomLevel: {“name”: "parent_member”}} |
"mx": {"bottomLevel: {“name”: "parent_member”}} | Selects multiple bottom-level members in a dimension Required input: an array of bottom-level members | { "field": "Year", "in": ["2020", "2021"] } "mx": {"bottomLevel: {“name”: "parent_member”}} |
MQL to filters JSON examples
Filter in English | MQL | filters parameter JSON |
---|---|---|
Select the bottom-level member “1200” in the dimension “Account”. | dimension('Account':'1200') | [ { "field": "Account", "eq": "1200" } ] |
Select the bottom-level members “2020”, “2021”, and “2022” in the dimension “Year”. | dimension('Year': union('2020', ‘2021’, ‘2022’)) | \[ { "field": "Year", "in": ["2020", "2021", "2022"] } ] |
Select all bottom-level members beneath the parent member “Revenue” in the dimension “Account”. | dimension('Account': bottomlevel('Revenue')) | [ { "field": "Account", "mx": { "bottomLevel": { “name”: "Revenue"} } } ] |
For the dimension “Year”, select the bottom-level members “2021”, “2022”, and “2023” For the dimension “Scenario”, select all bottom-level members beneath the parent member “Actual” For the dimension “Currency”, select all bottom-level members beneath the parent member “Local” For the dimension “Department”, select all bottom-level members beneath the parent member “All Departments - Planned” For the dimension “Placeholder 3”, select all bottom-level members beneath the parent member “Undefined” | dimension('Year':union('2023','2022','2021') dimension('Scenario' bottomlevel('Actual')) dimension('Currency':bottomlevel('Local')) dimension('Department':bottomlevel('All Departments - Planned')) dimension('Placeholder 3':bottomlevel('Undefined')) | [ { "field": "Year", "in": [ "2023", "2022", "2021" ] }, { "field": "Scenario", "mx": { "bottomLevel": { "name": "Actual" } } }, { "field": "Currency", "mx": { "bottomLevel": { "name": "Local" } } }, { "field": "Entity", "mx": { "bottomLevel": { "name": "All Entities - Planned" } } }, { "field": "Department", "mx": { "bottomLevel": { "name": "All Departments - Planned" } } }, { "field": "Placeholder 3", "mx": { "bottomLevel": { "name": "Undefined" } } } ] |
Updated 7 months ago