cancel
Showing results for 
Search instead for 
Did you mean: 

Truncate custom legend

Highlighted
05 Base Camper

Truncate custom legend

Hi Team,

I have created legends that appear with 2 decimal places in the client, but when published they show 30+ decimals!
Could you please tell me how to truncate the webview to only show 2 decimals?
The custom legend is:
approvals.SRCNAME Approvals - approvals.APRVCNT ( approvals.APRV% %)

the attached picture should show : Approvals - 13,120 (97.54%)
but shows: Approvals -13,120 (97.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%)

SnipImage.JPG



thank you
Tags (1)
6 REPLIES 6
Highlighted
Community Manager

Re: Truncate custom legend

Hi Sarb,

I am no expert on Regex syntax, but I think a regex in the legend area should work and might allow you to limit the characters showing there.
If I find any good examples of this I will be sure to send them you way. If you do design a good regex for this purpose, it would be great if you shared it here.

One other option is to add a calculated field to the display (Hidden from the regular graph, but select that in the legend portion).
Let me know if these tips were enough to help you try an approach, or whether you need more advice.
Highlighted
05 Base Camper

Re: Truncate custom legend

Hi Adam,

Thank you for your reply, i have developed the following regex:
\d+(\.\d{1,2})?

How do i use this in the label area? The command is displayed instead of the truncated value.
Highlighted
Community Manager

Re: Truncate custom legend

Create a new custom field on the display and apply the regex to the particular field there. Then use that field in the legend instead.
(It doesn't need to be the field plotted on the graph that you use in the legend)

Online Help topic on Calculated Fields: http://help.prognosis.com/dr/Prognosis_11-2/mergedProjects/System_Functions/HTML_Files/Displays/Displays-CalculatedFields.htm?zoom_highlight=calculated+fields

Below is an example of adding an extra field for the regex
Note: If I get some time, I'll see if the legend input box allows regex there too.

Calculated-Field-Example.JPG
Highlighted

Re: Truncate custom legend

Hi Sarb,

I have had this question asked earlier internally and what worked for me was to create a 'Numeric' user defined field that uses regex to only extract 2 decimal places precision out of the field. Interesting enough, it was for payments records.

So if you create a new user def field and show it in the pie and the legend, you should be good.

=RE("PostilionPosTransactionSummary.APRV%" , "(\d+\.\d{2})")? Numeric($1) : PostilionPosTransactionSummary.APRV%

Above syntax is matching it against a number followed by a decimal by atleast 2 digits and puts them into capture group $1, ignores the rest.

So in your case, you'd need:

=RE("approvals.APRV%" , "(\d+\.\d{2})")? Numeric($1) : approvals.APRV%

and then legend becomes:

approvals.SRCNAME Approvals – approvals.APRVCNT ( META.USERDEF01 %)

let me know if this works for you.

If my reply answered your question please click on the 'Accept as Solution' button to help others find the answer.
Thanks,
Shoaib
Highlighted
05 Base Camper

Re: Truncate custom legend

Thank you all for your help Smiley Happy
@Shoaib , I created a custom field and added the regex.

the regex i used is :
=Truncate( declines.DENY% ,2)
which is giving me 2 decimals Smiley Happy

I think development should look at this issue and allow formatting of the Approv/denial/standin % fields.
Highlighted

Re: Truncate custom legend

Glad it worked.

Some developers are also on the forum, so they are reading the feedback, I'll pass it on myself too.

If my reply answered your question please click on the 'Accept as Solution' button to help others find the answer.
Thanks,
Shoaib
Webinar: Keep the modern workforce connected

Unified Communications has always been an important part of companies' digital transformation efforts due to its ability to enable rich virtual collaboration and communication. But with COVID-19, we've reached a break-through point.

Join Bill Haskins, Sr. Analyst & Partner, Unified Communications at Wainhouse Research, and John Ruthven, CEO at IR discuss UC challenges companies are experiencing due to the COVOID-19 crisis.

Join webinar