PDA

View Full Version : Filter question



adonis
November 16th, 2009, 09:31 AM
I am trying to do a filter to exclude quantity and amount items when:
Quantity = 0 and Amount <= (absolute value) of 25.00 as there are both positive and negative numbers

any help here would be appreciated, seems like my process is not doing the filter properly

Data Kruncher
November 16th, 2009, 09:57 AM
Something like this?


Quantity<> 0 .And.
Abs(Amount)>25

adonis
November 16th, 2009, 10:01 AM
works some but not entirely

this is the normal data set i am working with
Qty Amt
-1000000 -1072597.78
-10000 -10819.17
0 -25.06
3000000 42.64
0 6324.78
-250 -6332.59
250 6332.6
0 0.01
0 -0.03
80 4471.88
-80 -4471.89
110400 251734.08
0 -0.34
180 5232.88
-180 -5232.87
1000 0
0 1087.36


after I use your condition,
Qty Amount
-1000000 -1072597.78
-10000 -10819.17
3000000 42.64
-250 -6332.59
250 6332.6
80 4471.88
-80 -4471.89
110400 251734.08
180 5232.88
-180 -5232.87


valid 0 items are being removed plus other records that are not even quantity = to 0.
The only 0 items to be removed are the ones with amount <= 25.00

any suggestions?

adonis
November 16th, 2009, 10:13 AM
if i use the following it does what i want but i am afraid if i use the following it could whack me out,
let me know if that 3rd condition would work because when i had the first 2 conditions there was one item where qty = 1000 and the amount = 0 and it was excluding it.
so i tried this, and it worked, but was wondering if it was a fluke?
initially i had the first part for a condition when <>0 to remove 0 items (amt+qty <>0) and then added the 3 other parts, it works from what i see, but just get nervous it may not be correct, though it is works

[NET AMT]+[NET QTY]<>0 .And. ([NET QTY]<> 0 .And. Abs([NET AMT])>25) .Or. ([NET QTY]=0 .And. Abs([NET AMT])>25) .Or. ([NET QTY]<>0 .And. [NET AMT]=0)

Grant Perkins
November 16th, 2009, 06:03 PM
adonis,

Try building each part of the filter separately and then combining them, one at a time, in a compound filter and compare the results at each stage. It may be the only way you can arrive at a comfortable feeling about whether the filter(s) give you what you want.

HTH.



Grant