Data Visualization - Pivot table dynamic group by
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 02:24 AM
Hi,
I have a pivot table data visualization and I want to be able to dynamically change the column group by using a dropdown.
I believe that I should be able to script the group by section of the data visualization but I cannot find any documentation on that this code should look like.
I need to have the row's grouped by 'assignment_group' and 'assigned_to' and have the column dynamic.
Could someone provide an example of what this code should look like or a link to some documentation I have missed that will explain what functions are accepted and what the expected returned values are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 04:55 AM
I have since found this doumentation that show in the typedefs section that the format need to be in somekind of array for groupBy but I'm still unsure how this should be formatted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 02:40 AM
I know it's an old topic, but this may be of some use to somebody:
The Group by (at least in case of data visualizations based on Indicators) needs to have the following structure:
[
{
"groupBy": [
{
"dataSource": "aW5kaWNhdG9yNjVkM2E3ZDBjM2Q2ODI1MDNjMTI0ZTBhZDAwMTMxMmExNzE2MjkzODM0NTg4",
"groupByField": "22ad97edc31282103c124e0ad00131d5"
}
],
"maxNumberOfGroups": "ALL"
}
]
As far as I know that's the minimum required.
- The `dataSource` needs to be fileld in, otherwise the group by will not be actually applied. The value there is the same as api.element.<id of data visualization>.dataSources[<index>].id Data visualizations can have multiple dataSources, but if you have only one the index will always be 0.
- The `groupByField` can be either empty - then no Group By will be applied, or set to the sys ID of an indicator you want to group by
- The `maxNumberOfGroups` is not actually required, but it can be set to either a number or "ALL", as in my example. As far as I know that's the only way you can overwrite the default max of 10 groups displayed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 03:01 AM
@Kyle Pasmore Did you get solution for this? I have similar requirement. Tried below script for dynamically binding groupBy but its not working.