on 2008 Jul 12 1:49 AM
I have a table that has one column for providerID and then a providerID in each of several columns if the provider is under a particular type of contract.
I need a distict count of each provider under each type of contract for every county in the US.
distinct count is almost always one more than the actual distict count because most counties have at least one provider that does not have a particular contract and the distict count counts the null value as a distict value.
I know I can alter the fields to have a zero for nulls, ask for a minimum count and then subtract 1 from the distict count if the minimum is zero, but I hope there is an easier way to figure distict counts of non-null values.
any suggestions?
Thanks,
Jennifer
Jennifer,
You can use the running totals that come with Crystal. You have to go to Evaluate-Use a Formula, click the box and say something like:
Not IsNull (TypeA_whatever).
Make a running total for each "type" of contract.
The Panda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Both of your suggestions work if you have a single field for contract type, but as stated, there is a field for each contract type
State, County, Provider, Type A, Type B, Type C, Type D, Type E, Type F, Type G
There are 7 types of contracts and one provider can have just one or all 7
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
*I need a distict count of each provider under each type of contract for every county in the US*
To the above requiremetn,
I will suggest the following approach.
Use group expert formula for country, contract and provider.
Now you will have the hierarchy to which level you want to apply distinct count. You can do it as suggested by ken hamady.
Regards
Usama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A distinct count will not count true Nulls, but will count blanks and empty string values. You can do a distinct count of an IF-THEN formula that returns a null value. I have written an article on this problem:
http://www.kenhamady.com/form14.shtml
Edited by: Ken Hamady on Jul 12, 2008 7:55 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.