Performance Analytics BreakDown Mapping Script

vineetk_195
Tera Contributor

Hi All,

I am trying out with a breakdown mapping via script.

But unfortunately when I run my job I do not get any scores for my breakdown, although it works fine if I directly select field and not the script.

Any suggestion would be appreciated.

Thank you

Vineet

10 REPLIES 10

Josh Cooper
ServiceNow Employee
ServiceNow Employee

If you're still having issues, I might be able to help - what are you trying to breakdown on, and would you mind posting the script?


I need help on creating breakdown mapping. I am facing same issue as above if I use a script for breakdown mapping.



I am trying to pull Function value from function field on task table and map with listed breakdowns on breakdown facts table. Below is the script that does the mapping. And also the screenshot of breakdown mapping that I created.



function getFunctionMapped(current){


  var vocUtils = new VOCUtils();


  var functionValue = vocUtils.getReqFunction(current);


  var normalizedFunction = vocUtils.normalizeReqFuncValue(functionValue);


  return normalizedFunction;


}




gs.log(getFunctionMapped(current));


getFunctionMapped(current);



It isn't throwing any errors nor logging above log line. Above util functions works, as I use them across application.



find_real_file.png


Please let me know where I am going wrong? Did you had any success on breakdown mapping?


Josh Cooper
ServiceNow Employee
ServiceNow Employee

I'm still not 100% sure on what you're trying to do, but I think I maybe see the difficulty.



The breakdown mapping script is trying to map this collected value, whatever it is to a breakdown from the breakdowns table, so the output it's expecting is sys_id of some record (breakdown) from the pa_breakdowns table.  



So when you do the breakdown mapping script, it's assuming that you've already set up the Breakdowns (automated or manual, and in this case it sounds like it will probably be manual) then the record itself is what's associating the score (count, sum, etc) to that Indicator, and the script is just telling it which breakdown to use.


Josh:



Do you   know if there is anyway to do a scripted breakdown to get a sum from a string field...



Use Case:     Business Unit is a String field so there is no table/choice list for this field...



if i want to do a breakdown around he business unit how would I script this??




more specifics on use...



we have created a u_global_user reference field on our task table... this value is populated on most record types via BR on insert.. so it contains who the record   is for.


now in performance analytics we would like to create a demand tab that allows that shows the bu's across the bottom.. and how many records that bu had opened for them stacked by task type... we would like to do this in PA so we can use drill downs and reporting capabilities for the BU's.   We can make a standard report that shows this with no issues.. but want to build it into a true PA dashboard.. <by dot walking u_global_user.business_unit>