Print Page | Close Window

Counting time points

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16154
Printed Date: 21 Apr 2025 at 1:32pm


Topic: Counting time points
Posted By: luluber
Subject: Counting time points
Date Posted: 11 Apr 2012 at 10:49pm
Hio all

im currently working on a report where i'd like to count how many times a time point appears and count it on a day by day basis.

once i have that sorted id then like to correlate this with a similar formula that counts how many times a numeric value appears in a field and group it as a count.

so if my field data looks like this:

time;      number
9:30        20
9:30        20
9:30        20
9:30        20

10:30       50
10:30       50
10:30       50
10:30       50

10:30       20
10:30       20
10:30       20
10:30       20

the initial 9:30 time is counted 4 times as the times and numeric values are the same. the 10:30 is counted as 2 sets of 4 as there is one numeric value of 50 and another of 20. these sets then given a tally for a summary report...

i may not have explained this well so feel free to ask questions.

but i feel i may be ask too much XD?

thanks in advance



Replies:
Posted By: rkrowland
Date Posted: 12 Apr 2012 at 12:48am

If I'm understanding you correctly this should get you what you need; however I could be going in the completely wrong direction.

 
Create a formula:
totext(hour({table.timefield}))
&
totext(minute({table.timefield})) 
&
totext({table.numberfield})
 
This gives each set of records a unique ID based on the time and the number, if you now group by this formula you can do a count of records.
 
ie using your example data set the result would be as follows;
 
group;    time;       number;      count;
93020                                       4
               9:30        20 
               9:30        20 
               9:30        20 
               9:30        20
103050                                     4
               10:30       50
               10:30       50 
               10:30       50 
               10:30       50
103020                                     4
               10:30       20 
               10:30       20 
               10:30       20 
               10:30       20
 
Regards,
Ryan.



Print Page | Close Window