Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Conditional count Post Reply Post New Topic
Author Message
Jgouger
Newbie
Newbie


Joined: 24 Oct 2012
Location: United States
Online Status: Offline
Posts: 1
Quote Jgouger Replybullet Topic: Conditional count
     Posted: 24 Oct 2012 at 10:31am

I’m trying to write a report that will show the # of orders for a customer and the # of orders with back orders.

 

Data looks something like this:

 

Cust       Order#                 Item#                    Qty BO

123         456                         A                             0

123         456                         B                             2

123         456                         C                             0

123         459                         A                             0

123         459                         B                             0

123         459                         C                             0

Summary would be 2 orders total and 1 order with a backorder

234         460                         A                             0

234         460                         B                             1

234         460                         C                             1

234         465                         A                             0

234         465                         B                             1

234         465                         C                             1

Summary would be 2 orders total and 2 orders with Back orders

 

Ideally I would like a Report summary section showing 4 orders and 3 backorders

Counting the orders is not an issue, counting the backorders is the problem.  I’ve tried formulas in the Order group footer that checks the sum of the Qty Bo field and returns 1 if the sum is >= 1 but then I cannot summarize that field in the customer group footer.

Any help is appreciated
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Oct 2012 at 3:43am
orders would be a distinctcount of order#field.
you can show the totals at any group level or the report total
back orders , if i understand you correctloy will need to use shared variables or running totals. YOu will need one per level you wnat to display it at.
here is the RT version (my preference)
right click on RT
select new
name=BackOrderTotal (or whatever)
field to summarize=order#
type=distinctcount
evalaute=use a formula
table.qytBO>0
reset=never (for report total)
place in report footer (RTs do not work in Headers
 
for group level totals do the eact same thing but change the reset to a group.
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