How to add a Boolean field as a Breakdown Source in Performance Analytics?

akhil19
Kilo Expert

The field that I am trying to add is "Has Breached" from Task_Sla table.

6 REPLIES 6

erik_brostrom
Mega Guru

I don't believe you can make a breakdown for a boolean itself (if I'm wrong, someone please correct me for I would like to know how as well, lol). What you can do as a workaround would be is to have a separate indicator for "Has breached" being true, and one being false.


paula_sylvester
Giga Contributor

I created a Breakdown on has breached using the incident_sla database view


steps below:


1) Create a Manual Breakdown


        name : sla has breached(manual)


          add only 1 value "true"


        copy the new breakdown sys_id for use in a datacollector script



2)Create a Data Collector Script


        Name: Incident.SLA.HasBreached


        Facts table: Incident SLA[incident_sla]


        Fields:   Has Breached [taskslatable_has_breached]


        Script:      


                  // provide sys_id of new manual breakdown and field name:


                              var breakdown = 'c7ddbd642ba7b1c83cacc71317da15d1';


                              var value = current.taskslatable_has_breached;


                  // do not modify past here:


                              var sysID = '';


                              if (value && value != 0) {


                                var gr = new GlideRecord('pa_manual_breakdowns');


                                gr.addQuery('breakdown', breakdown);


                                gr.addQuery('value', value.toString());


                                gr.query();


                                if (gr.next()) {


                                  sysID = gr.getValue('sys_id');


                                }


                    }


                    sysID || '';



3)Create a new Breakdown Source


        Name: SLA.Has.Breached


        Facts Table:   Manual Breakdown [pa_manual_breakdown]


        Conditions:       Breakdown is   "sla has breached(manual)"


        Label for unmatched: 'false'



4) Create an Automated Breakdown


        Name:         SLA Has Breached


        Breakdown Source:         SLA.Has.Breached (created above)


        Scripted is checked


        Script : Incident.SLA.HasBreached (created above)


Attach Breakdown to Indicators built on Facts table "incident_sla"



Hope this help,


Paula


I believe in Fuji you can do breakdowns on boolean fields now, anyone on fuji in production that can confirm?


We will be going to Fuji sometime this summer.   Above logic will transfer but if Fuji has an easier way to do a breakdown on a boolean I am not aware.