12 Replies Latest reply: Nov 15, 2016 11:12 AM by Shraddha Gajare

# Add % to label in Expression Editor

Hi,

I'm trying to format a calculation as a percentage in the Colors and Legend: By Measure: Expression Editor section of a Map chart.  Can someone tell me if that is possible and if so, how to go about doing it?  The basic formula is as follows:

count(distinct([Acct]))/sum(TotalEEs)

Thanks,

Bryan

• ###### Re: Add % to label in Expression Editor

If you create a master measure (Say MyMeasure) first and then select it in the Map property --> Appearance --> Colors and Legend --> Colors (Custom) --> By Measure --> MyMeasure

Will that work for you?

• ###### Re: Add % to label in Expression Editor

I don't think you need to format the expression which you are using for color.

Still you can try num(count(distinct([Acct]))/sum(TotalEEs),'#,##0.00%').

• ###### Re: Add % to label in Expression Editor

I tried the code you suggested but it didn't produce any changes to the format of the numbers.  Any other suggestions?

Thanks,

Bryan

• ###### Re: Add % to label in Expression Editor

It wont make any change in format because you are applying it for color expression.

If you want to change the format of number which are displayed on pop up(hover on points) then you will have to use num() in expression used in Measure section of chart.

• ###### Re: Add % to label in Expression Editor

What I'm trying to display is a combination of two measures.  I am using a Point Layer on the Map chart.

The bubble size is based on the number of employees in a group.  The Appearance of the bubbles is set in Colors and Legend: Custom, By Measure where the color is chosen based on the result of a calculation of unique customers out of total employees in a group, written as this in the Expression Editor: count(distinct([Acct]))/sum(TotalEEs).  We want this number to be expressed as a percentage.

I've tried a number of variations of num(count(distinct([Acct]))/sum(TotalEEs),'#,##0.00%') in the formula, but none of them have an effect on the display of the calculation.  Can you think of a way to make this happen, or am I basically out of luck?

Thanks again,

Bryan

• ###### Re: Add % to label in Expression Editor

Formatting the expression which is used for color or bubble size wont make any differece.

If possible provide a sample app..

• ###### Re: Add % to label in Expression Editor

Perhaps this will help.  I'm not sure how I would go about providing a sample app of this data.

• ###### Re: Add % to label in Expression Editor

When you hover on bubbles what does it show?

Do you expect % sign there?

• ###### Re: Add % to label in Expression Editor

It shows the number of employees in the group and a number like 0.15 instead of 15%, which is what we'd prefer to see.  Same for the legend--would prefer the numbers be expressed as percentages and not unformated numbers.

• ###### Re: Add % to label in Expression Editor

Legend will show the values which you measure will return.

And you are using color by expression so it will create buckets accordingly.

If you want percentage to be shown there you will need to change the number of measure which is displaying 0.15

Try changing it and then check what does it show in legends

• ###### Re: Add % to label in Expression Editor

As mentioned above, the number in the measure (influencing the size of the circle) is the number of employees in an employer group (formatted as 1,234).

The color of the circle is based on the participation rate in the employer group--that is, the number of customers we have in the employer out of all employees in the employer.  Example:  250 customers in a 1,000 employee group = .25 or a 25% participation rate.

Unless I'm mistaken, based on what you're saying there is no way to change the formatting of the participation numbers represented in the colors because we need the size of the circles to be based on the number of employees.  We can't have the measure be formatted as 12.3% because that would foul up the formatting of the number of employees.

• ###### Re: Add % to label in Expression Editor

Let me try it with some dummy data set.