Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Counting time points Post Reply Post New Topic
Author Message
luluber
Newbie
Newbie


Joined: 09 Apr 2012
Online Status: Offline
Posts: 4
Quote luluber Replybullet Topic: Counting time points
    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
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet 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.


Edited by rkrowland - 12 Apr 2012 at 12:51am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.029 seconds.