Alpha Video Training
Results 1 to 5 of 5

Thread: Filter issue

  1. #1
    Member
    Real Name
    Jo Hulsen
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    331

    Default Filter issue

    I have an issue with creating a combined filter in tablecount. The current filter as shown in the attachment counts records for each date.
    I need a further limitation so that only the amount of records for the variable field , in this case, "tbl.P"+str(var->i,1)+"bknr" is counted.

    Have been looking in writing complex expressions but cannot seem to be able to create the proper filter.

    I hope some of you are able to help me.

    Thanks very much in advance.


    ASGN_plan - 03-12-2016 -1.txt
    Jo Hulsen
    Dommel Valley Solutions
    The Netherlands

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Filter issue

    Guessing you want something like

    h = TABLECOUNT("plandatas","Plandatum = " + S_QUOTE(tbl.PLANDATUM)+ ".and. somefieldname ="+ s_quote(eval("tbl.P"+str(var->i,1)+"bknr")))
    There can be only one.

  3. #3
    Member
    Real Name
    Jo Hulsen
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    331

    Default Re: Filter issue

    Thanks Stan.
    With that example I as was able to have a filter not producing errors. However, it doesn't produce the required result.
    Each record has 5 fields tbl.P1bknr, tbl.P2bknr, etc.
    For each of those fields I need to count the records for each date when the field has a value of 1.
    Alternatively I could use a logical field tbl.Plan1, tbl.Plan2, etc.. that has a value of .T. or .F.
    Each date can have multiple records.
    The purpose of this exercise is to determine shifts with at least 2 persons.

    Thanks,
    Jo Hulsen
    Dommel Valley Solutions
    The Netherlands

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Filter issue

    In some instances the best approach is to create a summary table which counts/totals/etc and post the results back to the original table.

    In your situation it would seem you would summarize grouping on plandatum and date and for each combination

    tbl.P1bknr, tbl.P2bknr, etc fields use the expression

    if(tbl.P#bknr = 1,1,0)

    and the summarization expression would be Total - to yield the count.
    There can be only one.

  5. #5
    Member
    Real Name
    Jo Hulsen
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    331

    Default Re: Filter issue

    Thanks Stan for your advice.
    I will be heading in that direction. It will always be a limited amount of records, so I don't have to worry about performance.

    Thanks again,
    Jo Hulsen
    Dommel Valley Solutions
    The Netherlands

Similar Threads

  1. Drop Down Filter Issue
    By Charles Hoens in forum Application Server Version 11 - Web/Browser Applications
    Replies: 4
    Last Post: 02-21-2016, 11:50 PM
  2. Grid Filter Issue
    By Turnbullca in forum Application Server Version 11 - Web/Browser Applications
    Replies: 13
    Last Post: 09-19-2012, 06:43 PM
  3. QBE filter drop down issue
    By djcamo in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 06-05-2012, 02:22 AM
  4. filter issue
    By klamee in forum Alpha Five Version 10 - Desktop Applications
    Replies: 5
    Last Post: 02-19-2010, 06:42 PM
  5. Filter issue
    By DVSOL005 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 12
    Last Post: 11-18-2009, 12:36 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
  •