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

How to create custom name for measure values?

Answered
liangyi2012 asked on July 31, 2018

Like Excel pivot table, is it possible to create custom name for measure? For example, https://jsfiddle.net/rkprvhhs/836/, instead of saying Total Sum of Revenue, can we customize it to "Total Revenue"?

Attachments:
total-revenue.PNG

3 answers

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster July 31, 2018

Hello Liangyi,
Thank you for writing. Flexmonster provides a couple of options for configuring the captions which could be applicable to your case:

  1. You can change the localization labels for the aggregation caption. That allows changing "Total Sum of" to "Total" globally. It means that the same setting will be used for all the measures with the same aggregation. Please find the localization file "en.json" attached. Here is the example of setting localization: https://www.flexmonster.com/doc/localizing-component/.
  2. The other approach is to use showAggregationLabels property set with false: https://jsfiddle.net/flexmonster/ecet3kw6/. In such case, you can set the necessary caption explicitly: https://jsfiddle.net/flexmonster/ecet3kw6/13/.

Please let us know if the information above was helpful for you.
Regards,
Dmytro

Attachments:
en.json

Public
liangyi2012 August 1, 2018

Global localization might be a bit overkill since it's local renaming.
The second approach works, although it would be better if there's a UI for average user to add caption, or set the global showAggregationLabels option.
Thanks for the reply, at least we know what're the options at this moment.
 

Public
Tanya Gryshko Tanya Gryshko Flexmonster August 1, 2018

Hello, Liangyi,
Thanks for the quick update.
I would also add one more possible approach the options suggested by my colleague.
Please have a look at the following sample: https://jsfiddle.net/flexmonster/m2khqfzb/.
Here the same result is achieved by using grandTotalCaption property in the report (check line 32).
As about the UI for the end-user, you can either add a new tab to the toolbar or a new item to the context menu. Each of them can contain custom functionality. For more details please refer to our docs: Customizing toolbar, Customizing context menu.
Please inform me in case of further questions.
Regards,
Tanya

Please login or Register to Submit Answer