Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: how to take the sum of the count of a particular c Post Reply Post New Topic
Author Message
rrathour
Newbie
Newbie
Avatar

Joined: 21 May 2013
Online Status: Offline
Posts: 9
Quote rrathour Replybullet Topic: how to take the sum of the count of a particular c
     Posted: 12 Dec 2013 at 6:16pm
I am trying to filter the data on the basis of condition
it is like
select count(timesheet_ref),timesheet_date
from export_data
where export_status = 1
group by timesheet_date
 
eg
report columns
timesheet_ref     timesheet_date  ready_to_sent(having 2 rows)  Already_sent(another table data having 10 rows)
123       1/12/2013  1    4
124      2/12/2013  1    6
------------------------------------------------------------------------------------------------------------
Total                                   10(it should give2)                 10
--------------------------------------------------------------------------------------
to make it we need to use this formula
 
for total should be = sum(count([export_data.timesheet_ref]))
 
but above formula is not working.
 
Please help
 
                 
IP IP Logged
rrathour
Newbie
Newbie
Avatar

Joined: 21 May 2013
Online Status: Offline
Posts: 9
Quote rrathour Replybullet Posted: 12 Dec 2013 at 6:53pm
now i am able to do it by using the same group column by using
distinctcount instead of count.
 
But still anyone who can tell me of using sum with count.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 14 Dec 2013 at 9:24pm
Hi

If you have groups and withing a group you want to show sum(count(xx)) then you will have to write 3 formulas(running totals) :

Whileprintingrecords;
Numbervar x:=0  // this should be placed in group header


Whileprintingrecords;
Numbervar x;
X:=x+Count(xxx);  // place this formula in detail section


Whileprintingrecords;
Numbervar x;  // place this in group footer.

If no groups and you want to print only sum(count(xx)) then you can use last two formulas.

Last formula can be placed in report footer.




Thanks,
Sastry
IP IP Logged
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