Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting while filtering out " 0 " quantities

Status
Not open for further replies.

ILFletch

Technical User
Oct 9, 2000
1
US
I work for a distributor, and a customer of ours is asking for a report
that measures our handling of their orders. The unusual factor is that rather
than dealing in quantities ordered and shipped, they prefer to measure in
Lines Shipped vs Lines Backordered, and the like. This approach is foreign to
me. The beginning of the report is four columns, Lines Ordered, Lines Shipped
Same Day, Lines Shipped Day + 1, and Lines Shipped Day +2 . I can use the
"Count" function to give me this total. My next step, I thought, would be to
do a second "Count" , of the lines where the invoice had a quantity in the
Quantity Backordered (an item that did not ship the same day) column.
Unfortunately, this gives me a number that is equal to the total lines
ordered. The reason for this is that the report is also counting the " 0 "
entries, and every item that was filled completely has this. Basically, I
want the report to count ONLY the lines where quantity backordered is not
equal to 0. I am not aware of how to set up that condition. I was hoping you
might send me in the right direction. I am using Crystal 8 with a SQL Server
database. I have composed reports before, but this is my most complex
challenge, so I am hoping to conquer it rather than hand this off to others.

In case my explanation isn't clear, I'll describe this in a more graphic
sense:

An Order has three columns:
Quantity Ordered........Quantity Shipped..........Quantity Backordered
obviously, the quanties shipped and backordered should add up to the quantity
ordered.

in a day, if
Order AAA has
two lines, one of which was a backorder,
1 / 1 / 0
5 / 3 / 2

and order BBB has three lines, and also has one backorder
2 / 1 / 1
3 / 3 / 0
1 / 1 / 0

The report should look like this:
5 lines ordered
3 lines shipped same day
2 lines backordered

However, since the current method counts the zero quantites, it shows
5 lines ordered
5 lines shipped same day
5 lines backordered

[sig][/sig]
 
On any line create a formula that says:

If {QtyBackordered} > 0
then 1
else 0.


This will put a 1 on any line with backordered Qty. Then SUM this formula column rather than counting it. You can do this when you want any kind of conditional total.

You can also do a running total that counts but has a condition formula in the &quot;evaluate&quot; setting. Matter of preference which you do. [sig]<p>Ken Hamady- href= Reports Training by Ken Hamady</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top