report filter problem???

krazy89krazy89 Member Posts: 30
Hi everyone,

i just tried to run a custom made report with a filter on the Salesperson Code field:

<>*DEMO|<>*STAFF

basically i don't want any salesperson code that ends with DEMO or STAFF... but this filter doesn't work... can anyone help me to find an easy solution to this?

Thanks,

KraZy
KraZy

Comments

  • matttraxmatttrax Member Posts: 2,309
    You want to do <>*DEMO & <>*STAFF

    Yours didn't work because of this:

    Say the salesperson is NAVDEMO. The first part of your filter, <>*DEMO returns false. The second part returns true.
  • krazy89krazy89 Member Posts: 30
    Hey there.. thx for the fast reply...

    logically that makes sense... but i've even just tried:

    <>*DEMO

    and even that doesn't work.... it's like there's no filter at all...

    KraZy
    KraZy
  • jlandeenjlandeen Member Posts: 524
    Given that you are working with a custom built report - have you checked if there is any code in the report itself that applies filters to the Sales Person field? If so that could be overwriting your filter entered at run time.

    Another issue I've seen in the past is that there are multiple data items used in a report and selectively some filters may get passed between them. Is there anything like this happening?
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • krazy89krazy89 Member Posts: 30
    hey,

    no there's no other filtering that should be overriding the inputted filters...

    i'm really confused about this one.. the logic is there... the syntax looks right... just doesn't do the filter properly....

    KraZy
    KraZy
  • matttraxmatttrax Member Posts: 2,309
    I know I've had problems where sometimes when I set a filter it actually looks for the * as a literal * and not a wild card. I can't remember exactly what I did to make it do so or how I fixed it, but I know it was just playing with the syntax. Maybe that's what is going on.
  • krazy89krazy89 Member Posts: 30
    hey... under the properties of the Sales Invoice Line table, there's something in the DataItemTableView and it does do a filter of quantity = 1..

    does that prevent all other filters that are applied to it????

    i certainly hope it doesn't.. but that's the only other filter that i see anywhere...

    KraZy
    KraZy
  • SavatageSavatage Member Posts: 7,142
    how many different types of <something>Staff or <something>Demo do you have?

    losing the wild card would help

    <>MYSTAFF&<>MYDEMO&<>YOURSTAFF&<>YOURDEMO
  • krazy89krazy89 Member Posts: 30
    hey there...

    well.. we have about 12 sales reps.. and each one has a DEMO and a STAFF account....

    so it's only 24 in total... but it's such a hassle to do it that way...

    <>*DEMO
    <>*STAFF

    i don't understand why those don't work... there must be something to it.... i'm just not seeing it...

    KraZy
    KraZy
  • SavatageSavatage Member Posts: 7,142
    If you want these salesperson accounts with DEMO & STAFF fitered out in more that just this instance..say they are not actually regular sales people then it might be easier to add a field to the salesperson/purchaser table.

    Such as a boolean called DEMO-STAFF where you can have it checked off.
    Then in your report or any future reports you can check the table the set the filter DEMO-STAFF = no.

    I thought that filter did work with SQL but not on native. :-k
  • krazy89krazy89 Member Posts: 30
    so retarded... i don't believe i can't do this simple filter....

    i'm not gonna be able to sleep tonite!

    KraZy
    KraZy
  • SavatageSavatage Member Posts: 7,142
    Yeah that <> & * don't get along too well
  • DenSterDenSter Member Posts: 8,305
    I like the idea of adding a field. That is much easier to filter on.
  • matttraxmatttrax Member Posts: 2,309
    One of these has to work

    SETFILTER(Code, '<>*DEMO')

    SETFILTER(Code, '<>*%1', 'DEMO');

    I think the second one is more likely. There's only so many ways to set a filter.
  • krazy89krazy89 Member Posts: 30
    hmm.. thx for the suggestion... but i'm trying to apply this filter at run time... and not in the code behind...

    Any other suggestions??? anyone know if there's a problem with using the NOT and * together like that???

    KraZy
    KraZy
  • matttraxmatttrax Member Posts: 2,309
    I have been able to set filters like the ones described on a built in Navision report. Specifically the item list report. I don't know why yours are not working.

    You shouldn't have to do a work around, but you might have to. I guess you could try to set the filter in code in the onpredataitem trigger. I would do it on the first lines, that way you can tell if there might be any code that is changing the filters at run time.

    If the report is always going to use this filter that's what you should do anyway. If it is not you could add a checkbox to the request form that tells the report to set this filter with code.

    Best of luck.
  • anniqaanniqa Member Posts: 16
    <>*DEMO&<>*STAFF. The or-operator doesn't work here
Sign In or Register to comment.