Posted: 2011-08-11 14:57 |
I want to build a report that shows all the organisations who have done business with us, but not within the last 2 months. I've tried doing this with opportunities and can identify the ones that closed more than 2 months ago but these customers might also have an opportunity that closed within the last 2 months. How can I just identify the ones who haven't done business with us recently? |
Posted: Fri, 12.08.2011 - 10:35 |
This is a great example of when using the Group Concatenation function is helpful. You're quite right that it's easy to identify customers who did business with you more than 2 months ago but you need to see only those who did business more than 2 months ago and haven't done business with you since. The following example shows an Opportunity report and uses the Close Date as the date to identify when the business was conducted. However, you could build a similar report based on Customer Orders or Invoices and use the document date to identify when the business was conducted.
Within an Opportunity report:
GROUP_CONCAT(IF(DATEDIFF(CURDATE(), close_date) >60, 'Old', 'Recent') SEPARATOR ', ') You don't have to use the SEPARATOR ', ' part if you don't want to - it's there to create a comma and a space between each entry in the string so it's easier on the eye.
At this point your report should look something like the one shown below (click to enlarge).
Notice that the row for ORG-1 (Osiris Corporation) shows two entries of Old, meaning that there are two Opportunities for them each of which has a Close Date that is more than 60 days ago. The rows for ORG-7 (Addvantage Media) and ORG-61 (ABC Company) have both Recent and Old Opportunities. It's rows like this that you want to exclude from the report because, although these companies did business with you more than 60 days ago, they have also done business more recently. To do this:
You should now have a report that shows one line item for each company who hasn't done business with you recently. NOTE: Within an Opportunity report you'll want to apply criteria to limit the results to only those Opportunities that have been won, rather than ones in the pipeline or that were lost. If you use an Order or Invoice report, this won't be necessary. |
Posted: Tue, 13.08.2013 - 09:57 |
In the next release of Workbooks, due out in late summer, you can build the same report by undertaking the following steps:
The details view now shows a list of all Organisations with Opportunities and their Close Dates. A Summary View can be built to show only Organisations who you haven't done business with during the last 60 days. To do this:
'GROUP_CONCAT(IF(DATEDIFF(CURDATE(), PARENT('Close Date')) >60, 'Old', 'Recent') SEPARATOR ', ')' This formula looks at the Close Date of Opportunities and works out whether it's more than 60 days ago and returns the word 'Old' for ones that were more than 60 days ago and 'Recent' for the ones with a Close Date within the last 60 days. This column then concatenates (puts into one long string) all the results.
You should now have a report that shows one line item for each company who hasn't done business with you recently. NOTE: Remember that within an Opportunity report you'll want to apply criteria to limit the results to only those Opportunities that have been won, rather than ones in the pipeline or that were lost. If you use an Order or Invoice report, this won't be necessary. |