Print Page | Close Window

Using count on multiple conditions

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17490
Printed Date: 26 May 2024 at 9:38pm


Topic: Using count on multiple conditions
Posted By: Justus
Subject: Using count on multiple conditions
Date Posted: 04 Sep 2012 at 5:36am
Hi,
 
I think/hope this is a simple question. Smile
 
In my report I use a table that contains the following fields:
- Companies.SalesManager
- Companies.UniquedID
- Companies.StateChange
- Companies.State
 
What I am trying to do is to make an overview per sales Manager of the companies he/she is responsible for that:
1- have the State 'contacted'
2- have a StateChange that is in last 30 days
 
What I started to do is just group by sales Manager, but then I got lost as the count function does not seem to allow for multiple arguments.
 
Help on this would be greatly appreciated!



Replies:
Posted By: comatt1
Date Posted: 04 Sep 2012 at 8:44am
use running totals, they are pretty self explanatory and easy to use.

Otherwise shared variables would work.


Posted By: hilfy
Date Posted: 05 Sep 2012 at 4:09am
Or you could do something like this:
 
If {Companies.State} = 'Contacted' or {Companies.StateChange} >= CurrentDate - 30 then 1 else 0
 
You would then SUM this formula to get the count you're looking for.


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window