Placeholder

Customer Forum

Count of Summary

Craig Posted: 2023-07-20 14:34

In my report I want a count of how many times the same 'Summary' exists.

In this code I'd like to drop RE: FW: etc as well.

We get a lot of duplicate emails so would help flag if there are other related emails.

Ashley (Workbooks Online) Posted: Fri, 21.07.2023 - 13:20

Hi Craig,

Thank you for your query. I have looked into this and can confirm there are two methods that can be applied here: a replace formula which you can find more information on here: https://www.workbooks.com/d8/forum/identifying-duplicate-organisation-r… and a sub-string formula which you can find more information on here: https://www.workbooks.com/d8/forum/returning-sub-string-string

In my screenshot below, you can see I have a report which has 32 records.

I would recommend using a REPLACE formula Firstly to remove FW: RE: with REPLACE method you will want to add a calculated column that uses formula REPLACE(REPLACE( subject, 'Fwd: ', ''), 'Re: ','')
Once you run the report you should see the column appear without FW: RE: in the subject line.

Then to get get a count of the number of duplicates by 'Subject' you will need to add another calculated column and name it "Email as a number" then use formula:
IF( subject IS NULL, 0,1)
We need to give every email a value of 1 to count them up.

This will add another column that shows a 1 for an email with a subject.

From this point, you will want to add a summary view of the report. You can call this something like Emails and Duplications. Now you can add a grouping column and select the column name that you chose for the email without the FW: RE: and then add a value column>summarised column and select it to run from the Email by number column. You can choose whether to show a total at the bottom of the column.

If you save and run this, you should be left with a summary view of a report which shows the email subject without FW: RE: and you should see a column which shows the number of times you have received that email subject.

There is an alternative way to do this as well. Problably not optimised in this situation as REPLACE is much simpler but it is a valid method and will work.

To remove with the SUB-STRING you will want to use the formula:
CASE
WHEN (subject LIKE '%Fwd:%' AND subject LIKE '%Re:%')
THEN (SUBSTRING_INDEX( subject, 'Fwd: Re:', '-1'))
WHEN (subject LIKE '%Fwd:%')
THEN (SUBSTRING_INDEX( subject, 'Fwd:', '-1'))
WHEN (subject LIKE '%Re:%')
THEN (SUBSTRING_INDEX( subject, 'Re:', '-1'))
ELSE (subject)
END

Arjun (Workbooks Online) Posted: Fri, 21.07.2023 - 13:42

Just to Illustrate a little further, here is the Details View for a Report we have made:

Image removed.

We can see, in the Highlighted example, both the Fwd: and the Re: have been removed.

The 'Email as a Number' field gives every email a value of 1, so that they can be added in the summary.

Our Summary View looks like below:

Image removed.

Grouping by the Email Subject means that only unique email subjects appear on each row, and the total has been calculated with a Summarised column based on 'Email as Number'