Tuesday, November 13, 2018

Create a Saved Search for Customers with Transactions on One Period but none on Another Period

Create a Customer Saved Search as follows:


1. Reports > Saved Searches > All Saved Searches > New.


2. Select Customer in the Search Type list.


3. Under the Criteria tab > Standard sub tab, set the following filters:


 Transaction Fields: Type = is any of Cash Sale or any transaction type
 Transaction Fields: Date = within 1/1/2011 - 12/31/2012 or any date range as appropriate
 Transaction Fields: Main Line = True


4. Under the Criteria tab > Summary sub tab, set the following filters:
 a. Field = Formula (Text)
    Summary Type = Maximum
    Formula = case when {transaction.trandate} between to_date('1/1/2011', 'MM/DD/YYYY') and to_date('12/31/2011', 'MM/DD/YYYY') then {transaction.trandate} else NULL end
    Formula (Text) = is not empty

 b. Field = Formula (Text)
    Summary Type = Maximum
    Formula = case when {transaction.trandate} between to_date('1/1/2012', 'MM/DD/YYYY') and to_date('12/31/2012', 'MM/DD/YYYY') then {transaction.trandate} else NULL end
     Formula (Text) = is empty

5. Under the Results tab, remove all fields, and set the following:
 a. Field = Name
    Summary Type = Group

 b. Field = Formula (Currency)
    Summary Type = Sum
    Formula = case when {transaction.trandate} between to_date('1/1/2011', 'MM/DD/YYYY') and to_date('12/31/2011', 'MM/DD/YYYY') then {transaction.amount} else 0 end
    Summary Label = 2011 Transaction Amount

 c. Field = Formula (Currency)
    Summary Type = Sum
    Formula = case when {transaction.trandate} between to_date('1/1/2012', 'MM/DD/YYYY') and to_date('12/31/2012', 'MM/DD/YYYY') then {transaction.amount} else 0 end
    Summary Label = 2012 Transaction Amount

6. Enter a name for the search in the Search Title > Click Save and Run.

The formula in 5.c. is expected to be zero because in this specific search, our filter says that we are looking for customers who have transactions (Cash Sale) in 2011 but none in 2012.
 

You can modify the date range as needed. For example, you are looking for customers who have transactions January 2012 but none in February 2012, you just need to change the date range in the Criteria tab > Standard sub tab, in Summary sub tab and also in the formula set in the Results tab.

 

 

No comments:

Post a Comment