Filter

pranciusprancius Member Posts: 12
Hello,

I have a question about filters.

For example i have opened table via (Object designer ->Select table -> Run)
For example table have colums a1, a2, a3

Is it possible to set filter where a1<>a2 ?

Regards,
Pranas

Comments

  • chengalasettyvsraochengalasettyvsrao Member Posts: 711
    prancius wrote:

    Is it possible to set filter where a1<>a2 ?

    In which table & which fields you want to filter ?

    Can you exlain with a example ?
  • pranciusprancius Member Posts: 12
    It is no difrence which table.

    Just need to know is it possible to add filter using F7 or CTRL+F7 where column1 <> column2

    Regards,
    Pranas
  • BeliasBelias Member Posts: 2,998
    no you can't filter those columns...
    if you've to do it only one time and there are not a lot of records, you can export the table to excel by copy/paste and do here the dirty job.
    if you've to do it in a process, loop the entire table, test a1<>a2 and do the job:
    mytable.findset;
    repeat
      if a1 <> a2 then begin
        //asdf
      end else begin
        //dsfa
      end;
    until mytable.next = 0;
    
    if it's user side (thus must be manually filtered), you've to think about evaluating a new boolean field to true if a1 <> a2
    in this second option, basically you put your code in the onvalidate trigger of both a1 and a2 fields...but maybe there are other places, depending on your needs and from how the code is developed (maybe sometimes the VALIDATE is not done for these fields)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • krikikriki Member, Moderator Posts: 9,110
    Actually, with a flowfield trick you can do that.

    Let's take the the T37:"Sales Line" as example.
    The filter you want (in the example): Quantity <> Quantity Shipped.

    You need to create new field "Value Is The Same" as a flowfield of type boolean.
    give it this formula:
    Exist("Sales Line" WHERE (Document Type=FIELD(Document Type),Document No.=FIELD(Document No.),Line No.=FIELD(Line No.),Quantity=FIELD(Quantity Shipped)))

    now you can filter as this: SETRANGE("Value Is The Same",FALSE);

    Remarks:
    -flowfields are not so fast to filter on.
    -in the formula, the first part of filtering must be done on ALL primary key fields because you need current record. And then you add a filter on the 2 fields you want to check.

    -If they are the same, the record itself will be found and your flowfield will be true. If they are different, the flowfield will be false.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • aquawateraquawater Member Posts: 71
    prancius wrote:
    Hello,

    I have a question about filters.

    For example i have opened table via (Object designer ->Select table -> Run)
    For example table have colums a1, a2, a3

    Is it possible to set filter where a1<>a2 ?

    Regards,
    Pranas

    Use Excel. Then learn VLOOKUP. \:D/
  • pranciusprancius Member Posts: 12
    Thank you all for answers. I have expected user friendly solution.
    I know workarounds, but they not good for me.
    Thank you, i got information which expected

    Regards,
    Pranas
Sign In or Register to comment.