Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to count number of records showing 0 qty Post Reply Post New Topic
Author Message
mjay83
Newbie
Newbie
Avatar

Joined: 02 Aug 2007
Location: Malaysia
Online Status: Offline
Posts: 3
Quote mjay83 Replybullet Topic: How to count number of records showing 0 qty
    Posted: 02 Aug 2007 at 4:28am
I got 3 groups in my crystal report with few records with 1 field name QtyOrdered
How do I calculate number of records with QtyOrdered= 0 and show it in the end of each group
 
I written out the formula as:
Numbervar Zero;
if  {StockOnHandOrderPlaced.QtyOrdered} = 0 then
(Zero:=Zero+1)
It calculating all records which is not according to groups, how do i change the formula so it can calculate group's record?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 02 Aug 2007 at 7:25am
Create a second formula:
Numbervar Zero;
Zero := 0;

Place this in the Group Header section to reset the running total. You can suppress it so that it isn't printed and it will still be calculated.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 02 Aug 2007 at 2:12pm
The other way I do these is with a formula like this:
 
If {StockOnHandOrderPlaced.QtyOrdered} then 1 else 0
 
I then do a sum of this formula at whatever group level I need it.
 
-Dell
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 02 Aug 2007 at 9:49pm
Ah yes. Good idea.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
mjay83
Newbie
Newbie
Avatar

Joined: 02 Aug 2007
Location: Malaysia
Online Status: Offline
Posts: 3
Quote mjay83 Replybullet Posted: 02 Aug 2007 at 9:57pm
Thanks for replies from BrianBischof and hilfy,
i change my formula to
 
If {StockOnHandOrderPlaced.QtyOrdered} = 0 then 1
else 0
 
and put it into details
And put a sum of the formula in the end of each group
and it works perfectly, Thanks!!Thumbs%20Up
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.016 seconds.