Specify an Aggregation Type for AQS Join Data
Overview
Following our previous announcement on the temporary change to the way AQS Join Query results are displayed in custom reports, we have now added an option to allow you to specify the aggregation behaviour via a setting on the table header in the report. Two options are available: TakeOne
, which takes a single item from the possible results to display as an example or Count
which will result the count of the linked results.
Who will this affect?
This change will affect anyone using the AQS Query Data source with join attributes within the Report Builder to build custom reports.
Details
We have now added support to set an aggregation type per data source header in custom reports.
This aggregation type can either be TakeOne
or Count
.
TakeOne
will take the item attribute value of whatever first item the join attribute comes back with.
Count
will set the total count of items returned by the join attribute and display it as "X Items".
This property is optional, if all the attributes along the join path have the max number of links set to one (max: 1
) in their options, it will default to TakeOne
, otherwise it defaults to Count
. This is in order to replicate behaviour provided through Data Explorer. As these header properties can only be set once the attribute type is defined, it can only be defined on data source editing.
Data Source Editing
PUT /api/custom-report/{customReportCode}/data-source/{code}
Prior to this change, editing an AQS Query data source would have been made using following the "EditDataSourceAqsQueryWebRequestModel" model.
This model has now been updated allowing you to specify an additional property called "headerSettings" which allows you to configure the headers further, as follows:
{ "discriminator": "EditDataSourceAqsQueryWebRequestModel", "name": "All dogs", "required": false, "signature": "618146945b5b25015cf8d186", "dodiCode": "designs_dog_5f181f89f4f5bf0066f80812", "attributes": [], "joinAttributes": [], "headerSettings": [ { "headerId": "myTakeOneHeaderId", "aggregationType": "TakeOne" }, { "headerId": "myCountHeaderId", "aggregationType": "Count" } ] }
The response model can still be in "EditDataSourceWebResponseModel", the change here being that the "headers" property found inside the "customReport" and "dataSources" properties, when the data source is of model "CustomReportAqsQueryDataSourceWebModel", will optionally contain an "aggregationType" property, highlighting the behaviour above.
Note that as part of this change, the default behaviour has been reverted to the Count
behaviour mentioned above (which used to be default until v2.29.0 when it was temporarily change to TakeOne
to avoid report failures as described here).
Example
Let's assume there is a project containing 4 job tasks. If the user would create a custom report using an AQS Query data source rooted on Projects and linking to Jobs via the Tasks Attribute (Project DS -> Tasks to Jobs DS -> Title). If a Table control was then added to the layout based on this data source, the display of the data in this table will change following this change.
Take One
Using the TakeOne
option, a single exemplar item is displayed e.g. JOB-9
. Note that this is not necessarily the first item in the list and is dependant on the order returned by the system.
Count
Using the Count
option, the number of linked items is displayed, for example: