Alpha DevCon 2018
Results 1 to 5 of 5

Thread: Need help with syntax in compound filter

  1. #1
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,121

    Default Need help with syntax in compound filter

    In the code below, I am trying to combine three individual filters into a single filter expression with an .or. operator. I believe that it must need parentheses like A .and. (B .or. C) but I can't figure out how to place parentheses to combine the three together into vfilter_p .and. (vfilter_acc .or. vfilter_poc). Any help is appreciated.

    Code:
    dim vstores_acquired as C=""
    dim vacc as C="Accent"
    dim vpoc as C="Pan Oston CA"
    dim vcs_proj_id="PRJ.00701"
    dim vblank as C=""
    dim vfilter_p as C
    dim vfilter_acc as C
    dim vfilter_poc as C
    dim vfilter as C
    
    'INDIVIDUAL FILTERS
    vfilter_p="proj_id="+quote(vcs_proj_id)+" .and. proj_store_lanes->Art_Tmplts_Code<>"+quote(vblank)
    vfilter_acc="proj_store_lanes->Chkstd_Man="+quote(vacc)
    vfilter_poc="proj_store_lanes->Chkstd_Man="+quote(vpoc)
    
    'COMBINE THE FILTERS    
    vfilter=vfilter_p+" .and. "+vfilter_acc+" .or.  "+vfilter_poc                   '<<<<<   LINE WITH PROBLEM
    
    'ACQUIRE THE STORE LIST
    vstores_acquired = set.external_record_content_get("s_proj_store_hdr_lanes","hsi_sto_id","cust_sto_id",vfilter)
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  2. #2
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,442

    Default Re: Need help with syntax in compound filter

    vfilter=vfilter_p-" .and. ("+vfilter_acc-" .or. "+vfilter_poc -")"
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  3. #3
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,899

    Default Re: Need help with syntax in compound filter

    A bit more involved but letting Alpha do the heavy lifting....

    tmp = combine_filters(vfilter_acc,vfilter_poc,"Or")
    vfilter = combine_filters(vfilter_p,tmp,"and")
    There can be only one.

  4. #4
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,121

    Default Re: Need help with syntax in compound filter

    Hi Al, Stan,
    Wow thank you very much. Both are definitely going into my code library.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  5. #5
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,442

    Default Re: Need help with syntax in compound filter

    Thanks, but Stan's is cooler..
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

Similar Threads

  1. DBF.filter syntax
    By vinyltap in forum Application Server Version 10 - Web/Browser Applications
    Replies: 8
    Last Post: 05-07-2010, 10:43 AM
  2. Filter Syntax
    By crimmelcp in forum Alpha Five Version 5
    Replies: 1
    Last Post: 07-23-2004, 05:09 PM
  3. Filter Syntax
    By tarlachmoorhouse in forum Alpha Five Version 5
    Replies: 8
    Last Post: 12-20-2003, 07:19 AM
  4. compound filter problem
    By eeetee in forum Alpha Five Version 5
    Replies: 8
    Last Post: 02-02-2003, 04:34 PM
  5. Filter syntax
    By Bill Harriff in forum Alpha Five Version 4
    Replies: 2
    Last Post: 06-16-2002, 06:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •