Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to render Percent Change Statistic in a Dashboard Widget

Danielle25
Kilo Expert

Hello,

I am trying to figure out how to render percent change of a particular indicator (New Incidents) for example using the API Method pa.getChangePercentage

Production documentation: https://docs.servicenow.com/bundle/paris-now-intelligence/page/use/performance-analytics/PAFormulaUtil/reference/PAFU-getChangePercentage_S_O_O.html

The catch here is that I am also looking to display this as the percent change you see when the indicator time series is "by month sum +".

How can I apply the timeseries to a formula indicator using this method? Here is the formula I currently have:

pa.getChangePercentage($[[New Incidents]],score_start,score_end)

I tried adding the time series to the indicator [[New Incidents / By month SUM +]] but this didn't render any results.

 

1 ACCEPTED SOLUTION

Hi Jeff,

I did actually figure this out. In order to render the % change using the month sum, I had to create a new indicator source with frequency set to Monthly and conditions that say "created last month".

For some reason when the indicator source conditions had "created on this month" the % change was 1 month off.

The widget is a time series where the volume is captured in columns and a secondary widget indicator renders a % change formula indicator that I created using a monthly indicator in a formula which has the pa.getChangePercentage method.

find_real_file.png

View solution in original post

4 REPLIES 4

jeffrubinoff
ServiceNow Employee

Danielle,

We don't allow SUM aggregates on percentage unit indicators because the results are usually mathematical nonsense. You can get around it by not specifying % as the unit. However, playing with this, I see only one score per month although it's a daily indicator, and the statistics and trend don't look meaningful at all. I doubt this is the formula you need.

find_real_file.png

May I ask what your business use case is, and then hopefully we can all come up with a formula that matches it?

Hi Jeff,

 

I have an internal client who has asked for this widget on a dashboard. The volume simply indicates "new" and I was simply using the new incidents indicator as a POC. I know that in the analytics hub, you can view the % change using By Month Sum + as the time series. I was hoping I'd be able to somehow render that in the PA widget.

 

find_real_file.png

Well, if you look at my screenshot, it sure isn't giving you this, even in Analytics Hub/KPI Details!

Still don't think By month SUM+ is what you want, because having a partial month at the end is going to be potentially very misleading at first glance.

Have you tried a time series widget with a column visualization and a Previous Period Chart? On either a By month SUM of the daily or on a monthly indicator on the same table, but unfortunately a new indicator source.

Hi Jeff,

I did actually figure this out. In order to render the % change using the month sum, I had to create a new indicator source with frequency set to Monthly and conditions that say "created last month".

For some reason when the indicator source conditions had "created on this month" the % change was 1 month off.

The widget is a time series where the volume is captured in columns and a secondary widget indicator renders a % change formula indicator that I created using a monthly indicator in a formula which has the pa.getChangePercentage method.

find_real_file.png