Can I create calculated fields on a Report?

ewilks
Giga Expert

I am trying to write a report where I return rows with number data fields. It doesn't matter from which table I'm getting the data, as this is a more general question.
In any case, I would like to know if it's possible to do any of the following.
1. calculate a field in the report: I get two number fields from a table and would like to, say, add the columns to display in a new column.
2. Create a new column and populate that column based on data in another column: e.g. If Column1 = blue then CalculatedColumn =12 else CalculatedColumn =6)
3. Count distinct: Retrieve a number of rows that would include data from a report accessing Tasks, Request Items and Requests, then find how many distinct Request Items there are (for instance, let's say I have 20 tasks for 16 RequestItems which were part of 10 Requests...then I'd like to see a distinct count of 10 Requests.

It seems like it would have to be possible, but if none of these is possible in a standard report, is there another approach to find this data? Please keep in mind that I'm just getting started in this and if you give me code, I won't have any idea where I would write or call the code.
Thanks,
Eric

13 REPLIES 13

Ken_Michelson
Kilo Guru

You will likely need to use the Custom Chart plugin to create this type of report that includes counts of distinct, etc. You could use a Pivot Table report, but I am guessing that is not what you are looking for.

http://wiki.servicenow.com/index.php?title=Custom_Chart_Data_Generation


Kostya
Tera Guru

Hello,

I guess it is not possible with normal ServiceNow Reportings. You could calculate this field on the table itself or in an additional table and create a database view.

But it would be great if I am wrong and there is a possibility. Because I needed something like this a couple of time already.

Kind regards
Konstantin


Hit the Thumb Icon and/or mark as Correct, if my answer was correct. So you help others to see correct responses and I get fame 🙂

Cheers,
Kostya

Ken_Michelson
Kilo Guru

I needed a similar thing today as well. In my case I just created a calculated field on the table itself, and included it in a database view I am reporting off of.


Yeah, the reporting application is quite simple and not flexible enough. Maybe it is worth for a enhancement request. I guess the new Performance Analytics (former mirror42) can do such thing, but it is too expensive 🙂


Hit the Thumb Icon and/or mark as Correct, if my answer was correct. So you help others to see correct responses and I get fame 🙂

Cheers,
Kostya