Could I Show "SUM(field_a) / SUM(field_b)" value in report?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 05:58 PM
Suppose that there are the following records in pm_project_task table.
(field_for_groupby, field_a and field_b are custom field.)
field_for_groupby | field_a | field_b |
GroupA | 83 | 91406 |
GroupA | 39 | 91302 |
GroupA | 84 | 2598 |
GroupA | 26 | 97044 |
GroupA | 10 | 77695 |
GroupB | 3 | 91406 |
GroupB | 5 | 91302 |
GroupB | 2 | 2598 |
GroupB | 7 | 97044 |
GroupB | 2 | 77695 |
I would like to display the value of "SUM(field_a) divided by SUM(field_b)" in the report.
However, the report designer has only the following items in the aggregation options.
What should I do ?
=====
I've added some information.
If the value I want to display is expressed in SQL, it will be as follows.
SELECT SUM(field_a) / SUM(field_b) FROM pm_project_task GROUP BY field_for_groupby
- Labels:
-
Reporting

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 06:09 PM
Hello,
You'd have to consider creating a function field: https://docs.servicenow.com/bundle/sandiego-now-intelligence/page/use/reporting/concept/function-fie...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 06:44 PM
Thank you for reply !
You can add a value to other field within the same record, but you can't seem to add a value to a field of the other record.
Please excuse my lack of explanation.
If the value I want to display is expressed in SQL, it will be as follows.
SELECT SUM(field_a) / SUM(field_b) FROM pm_project_task GROUP BY field_for_groupby

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 05:45 AM
Hello,
I'm sorry, your reply doesn't make any sense to me.
I don't know if you're replying to me meaning you're trying to use a function field, as I mentioned, which if so, would be helpful.
Otherwise, I don't know if you're telling me something else you're trying to do.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 06:57 PM
If the value I want to display is expressed in SQL, it will be as follows.
SELECT SUM(field_a) / SUM(field_b) FROM pm_project_task GROUP BY field_for_groupby