Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Can not do Count or Sum on a Numeric Field Post Reply Post New Topic
Author Message
rusty
Newbie
Newbie
Avatar

Joined: 07 Mar 2008
Location: United States
Online Status: Offline
Posts: 16
Quote rusty Replybullet Topic: Can not do Count or Sum on a Numeric Field
     Posted: 22 Oct 2009 at 10:50am
There are some formulas such as @_ONLINEFLG and Web Online Charge % of Ad Count (and more) that I want to Count or Sum at Group Footer 1 level. All these forlumas are Numeric. I am not able to do Count or Sum on these fields. Can you please help? Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Oct 2009 at 11:19am

in these formulas are you using NEXT() or PREVIOUS() functions or doing any Sum or count.

You cannot do a summary function on an field that already uses a summary function.
You would have to use Running Totals or Variable formulas.
IP IP Logged
rusty
Newbie
Newbie
Avatar

Joined: 07 Mar 2008
Location: United States
Online Status: Offline
Posts: 16
Quote rusty Replybullet Posted: 22 Oct 2009 at 11:26am
Thanks. But here is what I have in one of the formulas:
IF Sum ({Command.ONLINE_TEST}, {@_ORDER}) <> 0 THEN 1 ELSE 0;
I want the count of this Formula. I tried doing Running Total, but this Formulas does not show up in the List of Fields to do Running Total!
Ths
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Oct 2009 at 11:34am
Sorry, I should have been clearer.
You can often get to the same end result using a Running Total.
Rather than disecting your current formula please post a little sample data (as it is grouped) and explain what you need to count from that.


Edited by DBlank - 22 Oct 2009 at 11:34am
IP IP Logged
rusty
Newbie
Newbie
Avatar

Joined: 07 Mar 2008
Location: United States
Online Status: Offline
Posts: 16
Quote rusty Replybullet Posted: 22 Oct 2009 at 11:45am
Currently, the report is aggregating the data by Order #. Now the user wants the data aggregated by Sales Rep. So, at order # group footer,  this OnlineFlg formula (IF Sum ({@_ONLINE}, {@_ORDER}) <> 0 THEN 1 ELSE 0;) gives 1 or 0. I need to Count the rows from Order Level Grouping for each Sales Rep. Is this what you are looking for? Thanks for feedback!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Oct 2009 at 11:53am

Kind of.

It sounds like you are needing a conditional count of rows per group (order#). Is this correct?
If so, what is the actual condition (not using your if then formula) to include or exclude and what is a sample of this row level data.
IP IP Logged
rusty
Newbie
Newbie
Avatar

Joined: 07 Mar 2008
Location: United States
Online Status: Offline
Posts: 16
Quote rusty Replybullet Posted: 22 Oct 2009 at 11:59am
Yes, I need the Count of Order #'s for each Sales Rep where this formula (IF Sum ({@_ONLINE}, {@_ORDER}) <> 0 THEN 1 ELSE 0) returns 1.
FYI - @_Online= IF {PRODDEFS.ISONLINEPRODUCT} = 1 THEN 1 ELSE 0;
@_Order = RIGHT({ORDERS.ADORDERNUMBER},7)
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Oct 2009 at 12:15pm

I can take a stab at this but you might need to tweak it as I cannot visualize your full set up.

Create a Running Total:
Name= 'Rep Online Count' (or whatever you want)
Field to Summarize=Order#
Type of SUmmary=DistinctCount
Evaluate=Use a formula ... then add your formula ...  
{PRODDEFS.ISONLINEPRODUCT} = 1
Reset = On change of Group Pick Rep Group level here
Place it on the Group footer of the Rep grouping.
 
Does that do it?


Edited by DBlank - 22 Oct 2009 at 12:15pm
IP IP Logged
rusty
Newbie
Newbie
Avatar

Joined: 07 Mar 2008
Location: United States
Online Status: Offline
Posts: 16
Quote rusty Replybullet Posted: 22 Oct 2009 at 3:26pm
Thanks so much. Let me try that out and get back to you. THANKS
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