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!

Distinct Count of Job Code 1

Status
Not open for further replies.

report2000

Technical User
Mar 1, 2005
45
0
0
US
Hi,
I have the following sample Data Set

JobCode Region HourlyRate
------- ------ ----------
11 North $30
21 North $30
31 South $34
44 South $35
44 South <Null>
44 South $28

I am grouping by Region and then JobCode

Here is the formula I used to calculate the "NbrOfFacilities"
---------------------------
if isnull(HourlyRate)
then 0
else
1
---------------------------
Then I use the InsertSummary feature to sum the '1s'.
----------------------------
I would like to count only jobcode 44 once.
-------------------------------------------
How can I incorporate the distinctcount(jobcode) with my formula?

Thank you.
 
Try using a running total which does a distinctcount of{table.jobcode}, evaluates based on a formula (assuming you only want to count a job code if the hourly rate is not null):

not isnull({@hourlyrate})

Reset on change of region (assuming you want this count at the region level). If you want a grand total, create a second running total with reset = never.

-LB
 
All I get back is only 1s.
How can I sum a running total for each group?
Do I need to change my formula?
------------------------
if isnull(HourlyRate)
then 0
else
1
------------------------
 
Did you insert a running total using the running total expert and follow my directions? Can't see how you could get 1's. If this is a summary at the region level, you would reset on change of the region group and place the running total in the group footer for region. If it is for a report count, use reset never and place it in the report footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top