Is there a way to remove the % symbol from percent format and keep the values the same?

Answered
talha asked on April 1, 2021

I was looking at an example here Edit fiddle - JSFiddle - Code Playground
and I want to show the 13 only in the Relative KPI column without the % symbol.

7 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 1, 2021

Hello,
 
Thank you for reaching out to us.
 
We suggest creating a calculated value that would multiply the original value by one hundred to achieve this functionality. This measure would replicate values of the original measure formatted as a percent. However, it does not complement the value with a "%" symbol.
Please see the JSFiddle for the demonstration: https://jsfiddle.net/flexmonster/he3jz6uw/.
 
You may be interested in our guide dedicated to the calculated values: https://www.flexmonster.com/doc/calculated-values/.
 
Please let us know if it helps.
We are looking forward to hearing from you.
 
Kind regards,
Illia

Public
talha April 4, 2021

I am using percentofcolumn aggregation.

Can I replace it with a formula that does the same thing?

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 5, 2021

Hello,
 
Thank you for the clarification.
 
We want to explain that the calculated measure cannot replace the percentofcolumn aggregation.
Therefore, we suggest using the customizeCell hook to overwrite the cells' caption manually.
This API call allows the customizing of separate cells. For example, you can add links, custom styles, or formatting.
Please see the JSFiddle we prepared to demonstrate this approach: https://jsfiddle.net/flexmonster/qt6fj2yr/.
The following code snippet serves to remove the percent symbol from the measure:

flexmonster.customizeCell((cell, data) => {
  if (data.type == "value" && data.measure && data.measure.aggregation.includes("percent")) { //this condition check if the cell need to be customized
		cell.text = data.label.replace("%", ""); //the percent symbol is removed from the cell's label
  }
});

You can adjust the condition to match more specific cells.
 
Please let us know if it helps.
 
Kind regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 14, 2021

Hello,
 
We are reaching out to ask if the provided solution works for you.
 
Do not hesitate to contact us if additional questions occur.
 
Regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 21, 2021

Hello,
 
Our team is wondering whether our suggestion was helpful.

We are looking forward to hearing from you.
 
Regards,
Illia

Public
talha April 22, 2021

Yeah, the solution was great. It worked just fine. Thanks.

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 22, 2021

Hello,
 
Thank you for your feedback.
We are happy to hear it works for you.
 
Do not hesitate to contact us in case other questions arise.
 
Kind regards,
Illia

Please login or Register to Submit Answer