Count Distinct on Incident_Metric -> Number column

brandimore
Kilo Expert

Hello

I would like to count distinct on the Number column in this table. Unfortunately it's not an option when I go to review the list of Aggregates. I saw another post about creating a new Indicator and Source for this to work. This seems like a lot of work for something this simple, but I did this anyways. When I'm in my report it's not an option to select.

I want to make sure that I'm not making more work for something. Can someone confirm how you can make a new field as an option to Aggregate?

Thanks

Instanbul is the version I'm running. We do have PA also.

find_real_file.png

1 ACCEPTED SOLUTION

gr.reference_field = 'mi_field_value';


View solution in original post

21 REPLIES 21


find_real_file.png


Hi Arnoud! I finally got the access I needed to test. I think I'm missing something here. Here are my steps based on what you gave me



1. I created the placeholder reference field as you suggested.


2. I copied the Sys ID and ran the following script:




var sysID = 'd0871acedb004780fd9930cf9d96191b';  


var gr = new GlideRecord('sys_ui_hp_reference');  


if (gr.get(sysID)) {  


  gr.reference_field = 'mi_field_value';  


  gr.setWorkflow(false);  


  gr.update();  


}  



3. I got this as a result:   [0:00:00.002] Script completed in scope global: script


4. In my Interactive filter, I edited my placeholder to select the MI_field_Value but I don't see it.



find_real_file.png



5. In your testing, where did you see this field in the list? In the root or sub folders?



Thanks very much for your help! I'm almost there


The code I provided was when you use the DatabaseView Incident Metric, if your direct on the Metric Instance, omit the prefix mi_


Below the updated code:



var sysID = 'd0871acedb004780fd9930cf9d96191b';


var gr = new GlideRecord('sys_ui_hp_reference');


if (gr.get(sysID)) {


  gr.reference_field = 'field_value';


  gr.setWorkflow(false);


  gr.update();


}


Thanks Arnoud -   I am pointing to the table Incident_Metric. Based on what you're saying is that not the view? (as per my print screen)


A bit misunderstanding...



You should be good, it is now set to Field value


The trick is to set it using the script, because you cant via the picker.



Please test if the filter works now.



find_real_file.png