0

To remove a letter at the end of words in a list

Hi 

Is there a way to remove the letter S at the end of words in a list ?

In Excel one use =LEFT(B2;LEN(B2)-1

Thanks

24 replies

null
    • Fred
    • 3 yrs ago
    • Reported - view

    There is the length function: length(field name). Then you can use the substr, not the substring, function to get all text minus the last one: substr(“text string”,start position,length of sub-string)

    Maybe something like:

    let xLen := length(Field1)

    substr(Field1,0,(xLen-1))

    This assumes you don't have a space at end of any text.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Thank you Fred

     Does it mean that if my field is "Ordre"

     It shoud be :

    let xLen := longueur(Ordre)

    substr(Ordre,0,(xLen-1))

    • Addinsell
    • 3 yrs ago
    • Reported - view

    I tried it on another base where the champ is "name" and I got the error :

    The function is not define lenght (string) on the line 2, column 6AC75E0EB-7955-4172-B1BB-571613527052

    • Fred
    • 3 yrs ago
    • Reported - view

    Try putting a ; at the end of the first line. I'm sorry that I forgot to put that in. Any let statement needs a ; at the end.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Do you mean :

    let xLen := longueur(Nom);

    substr(Nom,0,(xLen-1))

    if yes I get this kind of error :

    Allways line 2 but now with the column 26 

    6693F416-03D4-46FF-9D71-FEA198FB63EE

    • Fred
    • 3 yrs ago
    • Reported - view

    What do you get if you changed it to:

    let xLen := longueur(Nom);

    xLen

    • Addinsell
    • 3 yrs ago
    • Reported - view

    The same error. (Line 2, column 26)

    • Fred
    • 3 yrs ago
    • Reported - view

    can you try length instead of longueur? I don't know what functions get translated and which one don't. Do you have a link to the French manual that lists all the functions?

    • Addinsell
    • 3 yrs ago
    • Reported - view

    > Line 1 column 24

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Same error with the 2 functions

    • Addinsell
    • 3 yrs ago
    • Reported - view

    I mean 

    let xLen := lenght(Nom);

    substr(Nom,0,(xLen-1))

     

    let xLen := lenght(Nom);

    xLen

    • Addinsell
    • 3 yrs ago
    • Reported - view

    There is no French manual for Ninox

    • Fred
    • 3 yrs ago
    • Reported - view

    Then I guess all functions are supposed to be written in English?

    If so, the length is spelled wrong in your forumla.

    This is what I have in a test field:

    let xLen := length(Location.City.'City Name');
    substr(Location.City.'City Name', 0, xLen - 1)

    and it works.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Ok it works like that. Thanks.

    But there is a little issue : the S has been remove but some "e" have also been remove !

    EG :

    Coraciiform instead of Coraciiforme

    Falconiform instead of Falconiforme

    • Addinsell
    • 3 yrs ago
    • Reported - view

    E1DF3DE0-C0A6-4FFF-A4ED-4F78DD8388D8

    • Addinsell
    • 3 yrs ago
    • Reported - view

    In fact the function removes the last letter but how can one ask it to dot it only if it is the letter ”S” ?

    • Fred
    • 3 yrs ago
    • Reported - view

    If you switch substr to substring to something like:

    substring(Location.City.'City Name', xLen - 1, xLen)

    That grabs the last letter.

    So you can do:

    let xLen := length(Nom);

    let xSearch := substring(Nom, xLen - 1, xLen);

    If xSearch = "s" then

    substr(Nom,0,(xLen-1))

    else

    Nom

    end

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Thanks Fred but I get the same issue all the "e" has vanished.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Sorry I made a mistake but

    I get

    ”A column has not been found :if on the line 3, column 2”

    BAFBF5E6-1C42-42D5-A33B-05FFBEC852FA

    • Fred
    • 3 yrs ago
    • Reported - view

    remember that all functions are lower case. look at line 3 and tell me what is wrong with it.

    Also your else should be Ordre not Nom, correct?

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Thanks Fred,

    You are right about the word "Nom" instead of "Ordre", I changed that.

    But I got always the "If" issue on line 3 column 2

    Should it be "if" instead of "If" ?

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Yes ! 

    That is right ”if”must be in lower case !

    Now that works !

    Thanks again, Fred.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    As you can see on the screen shot, strangely, some words have still an S at the end.

    How can one explain that ?

    • Fred
    • 3 yrs ago
    • Reported - view

    Since it only happens on some of the records, I would first take a look at the data to see if they are different? Why did ID 594 work and 285 did not?

    A guess is maybe they have a space at the end. The formula does not take into account spaces.

Content aside

  • 3 yrs agoLast active
  • 24Replies
  • 1358Views