7

acces to array items like with Where fonction

Hello to all,

This new forum made me want to share something with you 馃榿.

I chose this code which allows to find elements in a table by filtering as we would do with the Where function of Select.

var myTable := ["Jacques", "Marie", "Leon", "Nadine", "Marie-Claire", "Sylvain"];
myTable[like "Marie"]

 

Copy

 

result of formula :

30replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
    • Fred
    • Fred
    • 1 mth ago
    • Reported - view

    Ok, so I'm trying to remove one array from another.

    let array1 := [1, 2, 3, 4, 5];
    let x := [3, 1];
    array1[this != x]
    

    Doesn't return 2,4,5

    If x = 3  (a single digit) then it works).

    I'm obviously missing something here.

    Thanks in advance for any help.

    Like
    • Fred It works on the mac application if you put this code :

      let array1 := [1, 2, 3, 4, 5];
      let x := [1, 3];
      array1[var v := this;
          count(x[= v]) = 0]
      
      Like
      • Fred
      • Fred
      • 1 mth ago
      • Reported - view

      Thanks for figuring it out.

      It is not good that the two products don't function the same.

      Like
    • Fred
    • Fred
    • 1 mth ago
    • Reported - view

    I'm obviously not getting the logic behind all this so I'm putting this out there.

    Here is my code:

    let xH1 := allhito1;
    let xH2 := allhito2;
    xH1[var ah1 := this;
        count(xH2[= ah1]) = 0]
    

    The two fields (allhito1 & 2) are the results of select statements.

    Now taking the new formula from Jacques from below I thought it would do the subtraction of xH2 records from xH1, but I get the same number of records in xH1. If change xH2 to hard coded numbers that are in xH1, then they get subtracted properly.

    I think I need to add a var section to count(xH2...) but my little brain can't figure it out.

    Thanks all for your help.

    Like
    • Fred I copied your code and it works fine. 

      If allhito1 contains the records : A1,A3,A4,A5,A6,A8,A10,A12,A13, 
      and allhito2 contains : A4,A10,A11,A13,
      the result is: A1,A3,A5,A6,A8,A12.

      To do this test I modified your code as follows:

      let xH1 := (select Customer where 'First Name' like "a");
      let xH2 := (select Customer where 'First Name' like "e");
      xH1[var ah1 := this;
          count(xH2[= ah1]) = 0].string(ID)
      

      I tested it on the web and on the Mac application.

      Like
      • Fred
      • Fred
      • 1 mth ago
      • Reported - view

      Thanks Jacques. It was stupidity on my end. I was looking at the wrong field to subtract.

      Like
Like7 Follow
  • 7 Likes
  • 1 mth agoLast active
  • 30Replies
  • 276Views
  • 5 Following