Menu

Rollup Summary in Tables

Learn how to use the Flex Insights rollup summary to create intelligent aggregation in your reports.

New to Flex Insights? Learn more about Flex Insights' dashboards and reports here.

Rollup is a very powerful and important type of summary. It is an intelligent aggregation function that uses the original metric to calculate the aggregation (instead of simply summing or averaging individual rows). Summing and averaging of rows may lead to results that look like "sum of counts of sets that aren't mutually exclusive" or "averages of averages," which are not always the desired result.

image (28).png

Rollup on count measures

When you use rollup on a column that contains a count measure it does not do a simple sum of the individual rows. Instead, rollup calculates the underlying measure without the segmentation applied in the table. A sum of individual rows may cause "sum of counts" counting the same item multiple times in some cases.

In the following example, we have two conversations. Conversation A has two segments as Mary forwards a call to Josh. The second conversation has only one segment handled by Mary.

Rollup - Count Conversations - Raw Table.png

If you create a table with the number of conversations segmented by agents you will get this result:

Rollup - Count Conversations - Aggregate.png

The segmented table attributes two conversations to Mary because she participated in them. It also attributes one conversation to Josh because Mary forwarded a call to him.

The sum of rows results in three conversations because Conversation A is counted twice - once for Mary, once for Josh.

The rollup does not simply sum the rows. Rather, it calculates the metric without considering attribution to Mary and Josh.

Rollup on average measures

When you use rollup on a column that contains an average measure it does not do a simple average of the individual rows. Rollup calculates the underlying measure without the segmentation applied in the table. An average of individual rows may lead to calculating "averages of averages" which is often not desirable.

In the following example we have three segments handled by two different agents:

Rollup - Talk Time - Raw Table.png

If you create a table with average talk time segmented by agents you will get this result:

Rollup - Talk Time - Aggregate.png

The results differ because the simple average takes the averages of all agents and then calculates the average of those averages. This value may be significantly different from an overall average talk time of individual segments.

Average summary results in the formula ((1:00 + 9:00)/2 + 2:00)/2 = (5:00 + 2:00)/2 = 7:00/2 = 3:30
Rollup summary results in the formula (1:00 + 9:00 + 2:00)/3 = 12:00/3 = 4:00

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

Thank you for your feedback!

Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

thanks-feedback-gif