Options

Inverted filter ?

Jens_MadsenJens_Madsen Member Posts: 23
edited 2003-03-12 in Navision Attain
I have the following data in code fields:

100-1
100-2
100-34
200-34
200-435
200-64
300-654
300-7654

I wan't a filter that doesn't show values with prefix 100- giving me the result:

200-34
200-435
200-64
300-654
300-7654

I know how to make filter that show me values with prefix 100- which is @100-* giving me the result:

100-1
100-2
100-34

I can't use the method of marking the fields I wan't to show, it MUST be a filter.

I know the syntaks in sql-server which would something like
"select * from myTable where (not myField like '100-%')" though that really doesn't help me here :(

Comments

  • Options
    HMicklerHMickler Member Posts: 9
    You can use either >1* to filter out any codes starting with 1, but would then run into a problem when you get to 1000-1, 1000-34, etc. So, to be more specific, enter >100-*.

    Other filters that would work
    200-.. //excludes all codes that begin with a 1####
    200.. //excludes all codes that begin with a 100- through 199-
    <>100-* //same result as above
  • Options
    Jens_MadsenJens_Madsen Member Posts: 23
    The tricky part is that if i only wan't those that do NOT start with "200-".

    (Would have been a better example to start with if I had used "200-")
  • Options
    DenSterDenSter Member Posts: 8,304
    The tricky part is that if i only wan't those that do NOT start with "200-".

    (Would have been a better example to start with if I had used "200-")

    If I want a list of everything that isn't 0 for instance, I set the filter to <>0. Have you tried <>"200-*" or something like that? I haven't tried this, but that would be my guess.
  • Options
    HMicklerHMickler Member Posts: 9
    In this case, use the filter <200*|>299* (The | means OR). The <>200* will not work due to the way Navision reads the field values, but the filter above will work. It asks for anything less than 200* and anything greater than 299*. Best of luck!
  • Options
    Jens_MadsenJens_Madsen Member Posts: 23
    @HMickler

    Thx for the input. 8)

    I used your last example and came up with this:

    (<100-|>100-9999999999999999)&(<200-|>200-999999999999999)

    This effectiveliy blocks out all values beginning with 200- and 100-.

    Only thing missing is if the prefix is 01 or 123
    because it's numeric and not alfa-numeric.

    I'll continue experimenting and post the solution WHEN I find it. :D
  • Options
    Jens_MadsenJens_Madsen Member Posts: 23
    filters are messy! :?

    Specially in code fields.

    If the code field consists of numeric values like:
    1234
    01234
    012345
    0123456
    02345

    And the length of the code field is 7 the filter to filter out values with prefix 01 would look something like this:

    (<010|>019)&(<0100|>0199)&(<01000|>01999)&(<010000|>019999)&(<0100000|>0199999)

    If the prefix is something like 100- then the filter on the following data:
    1234
    100-4
    100-01
    100-456
    02345

    Would look like this:
    (<100-|>100-999)
Sign In or Register to comment.