Hello,
We are exploring the use of showing the aggregation labels in the measure captions and observed something we were not sure of.
In the following jsFiddle, we have a configuration such that the Price
measure does not have a custom grand total caption. In doing so, we can see that the Price
column reads "Total Sum of Price."
Similarly, if we add another Price
column and have the second one aggregate over the average
, we'd see two price columns captioned "Total Sum of Price"
and "Total Average of Price."
In this jsFiddle, we have an identical configuration, only with the Price
measure having a custom grand total caption of "Custom Price Caption."
In doing so, the column no longer adds the aggregation label to the caption, that is, the column is captioned "Custom Price Caption."
Moreover, if we add another Price
column similar to the above, we'd see two price columns captioned "Custom Price Caption."
despite having different aggregations associated with them.
Is this the expected behavior? If not, is there a way to show the aggregation labels on measures that have a custom grand total caption?
We've noticed the same behavior when the datasource is the custom api datasource - the jsFiddles above are configured with the a json
datasource for ease of configuration. Please let us know if the jsFiddles are not working or if we can provide any additional information!
Kind regards,
Henry
Hello, Henry,
Thank you for writing to us.
At the moment, aggregation labels are not added to custom grand total captions. Depending on your use case, we suggest the following solutions:
caption
property instead of grandTotalCaption
. The aggregation labels are added to the caption
by default. Here is an example: https://jsfiddle.net/flexmonster/b13o694x/.
"Total ... of ..."
to a custom grand total caption, this can be achieved via localization (see the localization labels list on GitHub).
We have prepared a JSFiddle for illustration: https://jsfiddle.net/flexmonster/z5xyqgb3/. In the example, we customized the grand total caption for the average aggregation by changing the corresponding localization label.
Please let us know if this would work for your case.
Kind regards,
Vera
Hello, Vera,
The localization approach will work for us. Would it be possible for us to put in a request so that the aggregation labels are added to the custom grand total captions? This is a low priority for us given the localization approach, however - it would be more of a convenience factor so that we don't have to add a localization for each aggregation.
Kind regards,
Henry
Hello, Henry,
Thank you for your response.
We are happy to hear that the localization approach would work for you. Please consider that it is possible to provide your own localization file with all the labels defined in one place instead of overriding each label explicitly in the component's global
object (see the following tutorial).
Regarding adding the aggregation labels to the custom grand total captions, our team would like to clarify some points:
Currently, if a measure does not have a custom grand total caption, aggregation labels are added to the measure's name. For example, if we have a measure named "Price"
, aggregation labels will get applied to it the following way:
"[aggregation_name] of [measure_name]"
"Sum of Price"
"Total [aggregation_name] of [measure_name]"
"Total sum of Price"
With this in mind, for some cases, just adding a caption
to change the measure's name could work (JSFiddle).
Could you please let us know why changing the measure names via captions won't work for your case? This will help us to understand the situation better.
Thank you, and looking forward to your feedback.
Kind regards,
Vera
Hello, Vera,
We had a discussion with our team and we found that we were not actually using the custom grand total captions as they were intended to be - we observed that our custom grand total captions were identical to our custom captions :). We've removed our customization of the grand total captions solved our issue by simply turning on the aggregation labels, so our request to add aggregation labels to custom grand total captions is no longer needed.
Kind regards,
Henry
Hello, Henry,
Thank you for the update.
We are happy to hear that specifying the caption
property and removing the grand total captions (grandTotalCaption
) solved the issue.
As always, feel free to reach out if there is anything else we can help you with.
Kind regards,
Vera