Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Counting unique dates Post Reply Post New Topic
Author Message
thegreenblanket
Newbie
Newbie
Avatar

Joined: 29 Aug 2007
Location: United States
Online Status: Offline
Posts: 3
Quote thegreenblanket Replybullet Topic: Counting unique dates
    Posted: 29 Aug 2007 at 8:15am
I need help creating a formula that will count all the saturdays in a column of dates. The problem I am running into is that there are multiple Saturday records and I only want each unique date counted once. For example my data would be:
 
Product   Date Sold
ABC         8/4/07 (Sat)
ABC         8/3/07
ABC         8/4/07 (Sat)
ABC         8/11/07 (Sat)
XYZ          8/1/07
 
The results I am looking for in the formula are for it to tell me that ABC was sold on a Saturday 2 times and XYZ 0 times.
 
Any help is appreciated! Thanks!
IP IP Logged
rnareshk
Newbie
Newbie
Avatar

Joined: 19 Jul 2007
Location: India
Online Status: Offline
Posts: 30
Quote rnareshk Replybullet Posted: 30 Aug 2007 at 12:51am
Did you try using running total?
Thank You,
Naresh.
IP IP Logged
thegreenblanket
Newbie
Newbie
Avatar

Joined: 29 Aug 2007
Location: United States
Online Status: Offline
Posts: 3
Quote thegreenblanket Replybullet Posted: 30 Aug 2007 at 5:52am
yes, but it kept giving a count of zero when it shouldn't. thanks thou
IP IP Logged
thegreenblanket
Newbie
Newbie
Avatar

Joined: 29 Aug 2007
Location: United States
Online Status: Offline
Posts: 3
Quote thegreenblanket Replybullet Posted: 30 Aug 2007 at 1:44pm
update - i still can not get the running total to work. the problem is that each product is in a different group and i need the running total to distinct count by date and reset in each group. i tried moving the running total to the header, but that did not work either.
 
any suggestions??
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 01 Sep 2007 at 8:24am

You should be able to resolve the problem using the Count function in Crystal this is from the CR Help files. More information including examples are found there.

-------------------------
Count (fld)
Count (fld, condFld)
Count (fld, condFld, cond)
Count (x)
Arguments
fld is any valid database or formula field that can be evaluated by the function.
condFld is a field used to group the values in fld by.
cond is a String indicating the type of grouping for condFld. You only specify this argument when condFld is a Date, Time, DateTime or Boolean field. For more information on the valid strings for this argument, see Conditions for summary functions.
x is an array of values that can be evaluated by the function being used.
Returns
Number

Action
Enables you to count the values that appear in your report (for a specified field). For example:

If a sales report includes all orders made and the amount of each order, you can compute the total number of orders that appear on the report (a grand total count).
If you break orders into groups (for example, orders grouped by the state that they come from), you can compute the number of orders per group (in this case, per state).
If you break orders into date or Boolean groups (for example, orders grouped by the month in which they were placed), you can compute the number of orders per group based on a particular change in the date or Boolean field (in this case, per month).
If you specify a set of individual values, you can compute the number of values in the set. For information on this kind of counting, see Array summary functions.
--------------------------------

*********Second Function that may be useful again from CR help
--------------------------------


Overloads
DistinctCount (fld)
DistinctCount (fld, condFld)
DistinctCount (fld, condFld, cond)
DistinctCount (x)
Arguments
fld is any valid database or formula field that can be evaluated by the function.
condFld is a field used to group the values in fld by.
cond is a String indicating the type of grouping for condFld. You only specify this argument when condFld is a Date, Time, DateTime or Boolean field. For more information on the valid strings for this argument, see Conditions for summary functions.
x is an array of values that can be evaluated by the function being used.
Returns
-----------------------------------------------

You should be able to use these to create the formula needed to return the count you want. If you need help writing the formula, post it so we can help troubleshoot it.

Hope this helps

Regards,

John W.
www.CustomReportWriters.net

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.000 seconds.