Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only show data if true every month for the last x months

Status
Not open for further replies.

divamom74

Technical User
May 17, 2013
3
US
Using Crystal Reports 10: I am writing a report used for trending where I need to know the customers had more than 4 transactions every month over the last 3 months. I have the customers grouped by customer and then by date (month). I am using Count to summarize the number of transactions. And the report is showing me per customer the months where there were more than 4 transactions. However, what I need is it to only show me the customers who had more than 4 EVERY MONTH over the last 3 months. Currently it will show me a customer had more than 4 transactions in any month during the time period, even if not every month during the time period. I don't want to see that customer at all. Help? Thank you!!
 
My thought is to create formulas that count for each of the last 3 months. Then have a formula that says whether all 3 monthly formulas are true. If they are True, then show the data.
I hope that helps.
 
That last part is what I'm having trouble with. Do you have an example of how to write that if all 3 months are true? It still shows me every month that is true.
 
Try this in the Select Expert - {Date} is your date field and Table is your data table

DatePart("m", {Table.Date}) = DatePart("m", CurrentDate) Or DatePart("m", {Table.Date}) = DatePart("m", CurrentDate) - 1 Or DatePart("m", {Table.Date}) = DatePart("m", CurrentDate) - 2

you'll have to use the Show Formula button to put it in (select any field to get into that)
Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top