The CreatorCon Call for Content is officially open! Get started here.

Add a column to a report that would get sum or count values from another table

Samar A
Tera Contributor

I am building a report and need help to include columns to show the sum or count from a different table.

 

For example, I have table-1 that lists all the students and the tutor class they are enrolled in.  Table-2 tracks all the time spent in tutor classes.  The custom column would show the sum of hours for each student in each tutor class.

 

Table-1:

Student-1 Math

Student-1 Writing

Student-2 Math

 

Table-2:

Student-1 Math     07.01.24 2 hr

Student-1 Math     08.10.24 2 hr

Student-1 Math     08.13.24 1 hr

Student-1 Writing 08.03.24 1 hr

Student-2 Math     07.03.24 1 hr

Student-2 Math     08.08.24 1 hr

Student-2 Math     08.18.24 2 hr

 

Report:

Name        Class     July24   August24

Student-1 Math     2 hr       3 hr

Student-1 Writing 0            1 hr

Student-2 Math     1 hr       3 hr

 

Thanks.

2 REPLIES 2

Samar A
Tera Contributor

I missed to include in my post to ask how do you add the columns that has the sum(hours) to the report.

olgaredkina
ServiceNow Employee
ServiceNow Employee

If you add one more field for table 2 - 'Month" (can be calculated based on the date field), you can achieve it with multi-pivot table report on top of table 2:

 

Rows: Name, Class

Column: Month

Aggregation - class duration