How to create a Function field with reports to generate True and False values?

Camila Godoy
Tera Expert

Hello - I am trying to create a report that will give me % of incidents that has a problem. The issue of grouping by the Problem field is that it shows empty and a bunch of problems instead of a group of problems. I wanted to use function field available in the report to create True and False values. Did anyone ever got this working? find_real_file.png

1 ACCEPTED SOLUTION

Uncle Rob
Kilo Patron

So as you probably already know, those function fields only have VERY VERY simple options.  I liken them to transform only... you can't use *logic* to change anything.  

I went with this.  If you take the length of any reference field you get 32 (length of a sys_id).  So I'll know an Incident is linked to a problem if (length of problem reference) / 32 = 1.  So I made a function that does exactly that.

find_real_file.png

And that yields a report that looks like this...

find_real_file.png

Which, if you make a pie chart out of....

find_real_file.png

I changed the label of the report so it reads better.  The 1 and 0 aren't great series labels... but I don't know any other way to do it.

View solution in original post

4 REPLIES 4

Kalyani Jangam1
Mega Sage
Mega Sage

Hi,

Please refer below docs

https://docs.servicenow.com/bundle/quebec-now-intelligence/page/use/reporting/concept/function-fields-reporting.html

https://docs.servicenow.com/bundle/quebec-now-intelligence/page/use/reporting/task/create-function-field.html

Uncle Rob
Kilo Patron

So as you probably already know, those function fields only have VERY VERY simple options.  I liken them to transform only... you can't use *logic* to change anything.  

I went with this.  If you take the length of any reference field you get 32 (length of a sys_id).  So I'll know an Incident is linked to a problem if (length of problem reference) / 32 = 1.  So I made a function that does exactly that.

find_real_file.png

And that yields a report that looks like this...

find_real_file.png

Which, if you make a pie chart out of....

find_real_file.png

I changed the label of the report so it reads better.  The 1 and 0 aren't great series labels... but I don't know any other way to do it.

Yes, this is also where I was able to get at. Thank you so much for your response,

Jay Ford
Tera Contributor

Used this thread to come up with this, which returns a true/false.

JayFord_0-1684870952490.png