display numbers in ascending order that are in a text field ?
Hi,
Is there a way to display numbers in ascending order that are in a text field ?
Otherwise how can I copy quickly numbers that are in text fields into number fields ?
Thanks
23 replies
-
If there is no text in the field you can create a new formula field called conv_TextField and have it set to number(TextField). That will convert the old text field into a number.
-
Alternatively
If you have already filled that field in many records and you decide to create a new number field
You could then add a button and insert this code to copy the contents of text field to the number field in all records
then once copied delete the first text field
TAB1 = your table name
TF1 = your text field name
NF1 = your Number field you create
for i in (select your TAB)[TF1 > " " and NF1 = null] do
let a := i.TF1;
i.(NF1 := a)
endMel
-
oops tht should read
for i in (select TAB)[TF1 > " " and NF1 = null] do
let a := i.TF1;
i.(NF1 := a)
endMel
-
Thanks Fred, thanks Mel.
Hi Fred,
about the function conv_TextField where do I find it ?
And I don’t understand how that function could change the numbers of the other field text where my numbers are typed.
Hi Mel,
did you change the part of the function : I do not see the difference…
-
conv_TextField is not a function it is just the name of the new field that you then type in number("name of field") in the formula. You can call the field whatever you want that makes sense to you.
-
Thankd Fred.
I called the field conv_TextField
but Sorry but I do not undestand what to do after…
-
Sorry for not being very clear.
You can delete this field and create a new formula field with the same name. The in the formula put in number("name of field").
-
Thanks.
Ok but you still do not explain what to do after having named the field.
(Sorry I am not very gifted in this kind of thing…)
-
Sorry, I used the wrong spelling. We are creating a Formule field.
Name it whatever you want
In the formula of the field put number("name of field").
-
Thank you.
Sorry I do not succeed.
-
-
Hi there -
What you are showing me is the database sorting properly. What trips everyone up is that 1 and 10 are sorted first then 2 and 20 and 200 or 2000. They all start with 2.
You need to add a 0 in front of the single digit numbers then they will sort first.
Something like:
if "nombre de espèces" < 10 then
0 + "nombre de espèces"
else
"nombre de espèces"
end
-
But the field with the function I create is full of 0 !
You speak about the old txt field !
-
My mistake.
That is weird. I just did it in my DB on a text field that has numbers and it shows up fine.
I noticed that in your formula Nombre has a lower case N, but your field name has an upper case N. Does that make a difference?
-
I tried with N unstead of n : same issue > 0 everywhere…
-
Well that has stumped me. I'm guessing that there is only numbers in the Nombre d'Espèces, so I don't know why it formula field is showing up as 0. Maybe someone else can shine some light on this.
Or you can do Mel's suggestion.
-
Ok.
Previously, on the start of the discussion you talked about ”conv_TextField»
Could it be the key of this mystery ?
conv_TextField unstead of number (”“) ?
-
-
Here's a video of this: https://www.dropbox.com/s/ldpg0abddjvtjqy/CalcNumber.mp4?dl=0
Steven.
-
In my first script I left your in - as i started to type your table name here !!! this should not be there
for i in (select your
-
Hi Steven, thank you.
I get this error :
"A column has not been find :Nombre d’espèces on the line 1, column 33"
-
I think the quotation marks (guillemets) are of the wrong type in the fieldname. Maybe it's better to click on the fieldname like:
Steven
-
Great ! Well done !
It works perfectly.
Thanks again, Steven.
Content aside
- 3 yrs agoLast active
- 23Replies
- 1419Views