How do I create a List report that counts number of PTASKs for Problem Records

everett_BRSPD
Tera Contributor

I want to create a list report that will provide a count of PTASKS for each problem record.  How do I create a filter that will provide the count of PTASKS for each problem record.  I tried to create a report of all PTASKS grouped by problem record, but that creates in incomplete list because it will not include Problem Records where there is not task.  The purpose is to audit problem records that do not have written PTASKS.  Thanks for looking and considering.

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@everett_BRSPD 

you cannot get it directly.

You need to use Database view by joining problem and problem_task table

AnkurBawiskar_0-1764562753760.png

 

Then create report on that database view table and do group by on Problem.Number

-> select table as database view

AnkurBawiskar_2-1764562820630.png

 

-> Type Bar

AnkurBawiskar_3-1764562862065.png

 

-> Group by -> Problem.Number (you need to dot walk here)

AnkurBawiskar_1-1764562802689.png

Output: Report shows 1 problem task per problem

Native table shows the same

AnkurBawiskar_4-1764562891090.png

AnkurBawiskar_5-1764562902480.png

 

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

OlaN
Tera Sage

Hi,

Ankur is partly correct.

You will need to create a Database view to combine the results of the two tables for your reporting purposes.

But in this case, you will need to add the second table (problem tasks) as a LEFT join, in order to show all the problems that are without any problem tasks aswell.

The default setting is to create a INNER join, which will only show records that combine the two tables together (i.e. has both a ptask and a prb).

Check out the docs for an example to do a left join.