0

Modify a function

Hi,

 

I tried that function.

 

let myV := Ordre;

if cnt(select 'Ajouts familles-Tableau 1'where Ordre = myV) > 1 then

"Duplicate"

else

null

end

 

It works but when there are duplicates all the duplicates are checked but there is not one no duplicate checked.

EG :

 

Ciconiiformes  duplicate

Ciconiiformes  duplicate

Ciconiiformes  duplicate

Ciconiiformes  duplicate

 

Galliformes duplicate

Galliformes duplicate

Galliformes duplicate

Galliformes duplicate

Galliformes duplicate

Galliformes duplicate

 

Is there a way to change that function adding this parameter show the non duplicate word ?

Thank you.

14 replies

null
    • Addinsell
    • 3 yrs ago
    • Reported - view

    2BD95875-ECB8-49BD-A09D-83EB9D744B7C

    • CRo
    • 3 yrs ago
    • Reported - view

    If I get you right, just change null to "No Duplicate"

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Thanks

     

    I tried this 2 scripts :

    let myV := Ordre;

    if cnt(select 'Oiseaux famille genres espèces'where Ordre = myV) > 1 then

    "Duplicate"

    else

    No Duplicate

    end

     

    let myV := Ordre;

    if cnt(select 'Oiseaux famille genres espèces'where Ordre = myV) > 1 then

    "Duplicate"

    else

    no duplicate

    end

     

    Same error : "A column has not been found no on line 5, column 3"

    • CRo
    • 3 yrs ago
    • Reported - view

    You need to put it into double-quotes because it is a text!

    let myV := Ordre;

    if cnt(select 'Oiseaux famille genres espèces'where Ordre = myV) > 1 then

    "Duplicate"

    else

    "no duplicate"

    end

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Yes ! It works. Great ! 

    Thanks again.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Is there a way to ask to the duplicates to be displayed one time ?

    • Fred
    • 3 yrs ago
    • Reported - view

    Not in the same table. Since you created a formula field in your table it checks each record and gives you a response by record.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Ok.

    Could you please tell me the way with another table ?

    • CRo
    • 3 yrs ago
    • Reported - view

    You should read the manual because another table is just change the table and field names. 

    I do not speak your language, but perhaps you want to have the item duplicate if families and ordre is equal with another item? Right now you just check ordre?! 

     

    let myId := Id;
    let myV := Ordre;

    let myF := Families;

    let original := first(select 'Oiseaux famille genres espèces' where Ordre = myV and Families = myF).Id;

    if original = myId then "Original"

    else if cnt(select 'Oiseaux famille genres espèces' where Ordre = myV and Families = myF and Id != original) > 1 then "Duplicate"

    else "no duplicate"

    end

    (Not tested!)

    Now you could filter original and no duplicates.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Thank you but what I am trying to do is to extract from a list of identical names only one of these names to be able to count them and have a list of orders.

    Indeed I have a very large number of orders of birds which are repeated for each species of bird and I would like to know how many orders there are.

    Of course, I could check off one by one the names of each order but it is laborious.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    About your last script there is ”original” inside.

    is there a script word or something else ?

    • Addinsell
    • 3 yrs ago
    • Reported - view

    About your last script there is ”original” inside.

    is it a script word or something else ?

    • Addinsell
    • 3 yrs ago
    • Reported - view

    About the relational tables I know the way to do it but what I don’t understand is how to export in the second one only the original names of the orders and not all the same orders.

     

    Columbidae X
    Columbidae

    Corvidae  X
    Corvidae

    Corvidae

    Corvidae

    Cuculidae x

     

    Gruidae X

    Gruidae

    Gruidae

    Gruidae

    Gruidae

    Leiothrichidae X
    Leiothrichidae


    Meropidae X
    Meropidae

    Meropidae

    Meropidae

    • CRo
    • 3 yrs ago
    • Reported - view

    You should really read the manual! Double-quotes are always text so "word" is a text and 'word' is a field.

    Like I posted before, you need to get the original by get first occurrence of your item and mark that as "original". Mark all other with "duplicate".

    Do you know the table-filters?

    Better way to get the number of orders is to count your orders.

    New function field:

    let myV := Ordre;

    let countOrders := cnt(select 'Oiseaux famille genres espèces'where Ordre = myV);

    countOrders;

     

    That should do it.

Content aside

  • 3 yrs agoLast active
  • 14Replies
  • 783Views