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
- 
  
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.
 - 
  
Thank you Fred
Does it mean that if my field is "Ordre"
It shoud be :
let xLen := longueur(Ordre)
substr(Ordre,0,(xLen-1))
 - 
  
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 6

 - 
  
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.
 - 
  
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

 - 
  
What do you get if you changed it to:
let xLen := longueur(Nom);
xLen
 - 
  
The same error. (Line 2, column 26)
 - 
  
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?
 - 
  
> Line 1 column 24
 - 
  
Same error with the 2 functions
 - 
  
I mean
let xLen := lenght(Nom);
substr(Nom,0,(xLen-1))
let xLen := lenght(Nom);
xLen
 - 
  
There is no French manual for Ninox
 - 
  
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.
 - 
  
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
 - 
  

 - 
  
In fact the function removes the last letter but how can one ask it to dot it only if it is the letter ”S” ?
 - 
  
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
 - 
  
Thanks Fred but I get the same issue all the "e" has vanished.
 - 
  
Sorry I made a mistake but
I get
”A column has not been found :if on the line 3, column 2”

 - 
  
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?
 - 
  
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" ?
 - 
  
Yes !
That is right ”if”must be in lower case !
Now that works !
Thanks again, Fred.
 - 
  
As you can see on the screen shot, strangely, some words have still an S at the end.
How can one explain that ?
 - 
  
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
- 4 yrs agoLast active
 - 24Replies
 - 1404Views
 




