Need a special offer?Find out if your project fits.
+

Custom Datasource API - Precendence of Aggregations in fields response

Answered
Henry asked on July 21, 2021

Hello,
 
On version 2.8.33, with the response for the /field request, we noticed that if the array of aggregations was empty for a particular field, the array of aggregations at the top level did not take precedence. For example, on version 2.8.33, the following response for the /field request:

{
aggregations: {
number: ["sum"]
},
fields: [
{
uniqueName: "Test",
aggregations: []
}
]
}

would result in "Test" having no aggregation options in the fields popup. However, in version 2.9.3, the response does result in "Test" having the sum option in the fields popup.
 
Our intent with the empty aggregations array was to prevent a particular field from being aggregated and form being placed in the "Values" section in the fields popup. For example, we wanted to restrict "Test" to only being placed into "Report Filters," "Columns," or "Rows," but not "Values" since we wanted "Test" to act more as a "dimension" than a "cell" value.
 
Is there a way to turn off all aggregations for a particular field despite having a non-empty aggregations array at the root level?
 
Kind regards,
Henry

3 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 22, 2021

Hello, Henry,
 
Thank you for creating a separate forum thread and for providing the details.
 
We want to confirm that recent updates changed the behavior of the component when an empty aggregations array is received. From now, root aggregations are going to be used instead.
 
Could you please specify how critical is this behavior for your case?
 
Looking forward to hearing from you.
 
Kind regards,
Illia

Public
Henry July 22, 2021

Hello, Illia,
 
It is of semi-importance to us. We have our own way of saving off the slice object which involves distinguishing which measures are "dimensional" (no aggregations) and which are "values" (do have aggregations). We were taking advantage of the fact that measures that have no aggregations could not appear in the measures property to avoid unnecessary database operations.
 
However, we did notice that if we don't provide the root aggregations and instead provide the aggregation information at the fields level in version 2.9.3, we are able to get the behavior that we desire. So for now, we do not need an immediate fix in upcoming releases.
 
Kind regards,
Henry

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 23, 2021


Hello, Henry,
 
Thank you for your feedback.
 
We have added your request to our wishlist. We will notify you if something is changed on this point.
 
Feel free to contact us if other questions arise.
 
Kind regards,
Illia

Please login or Register to Submit Answer