This content has been marked as final.
Show 3 replies

1. Re: SORTING A NUMERIC FIELD AS TEXT
rgordon Oct 29, 2015 10:27 AM (in response to juandent)There wasn't a question to answer but I'm assuming your question was how to avoid numbers sorting like
1
11
12
2
3
34
4
YOu need to add leading zeros to numbers in your calculation so the number sort like
01
02
03
04
11
12
34

2. Re: SORTING A NUMERIC FIELD AS TEXT
juandent Oct 29, 2015 10:35 AM (in response to rgordon)Thank you. Can you verify if the following formula would work also for negative numbers? Is there an easiest way?
take a large number (larger than the absolute value of the maximum value in the list) and add the negative value. The result is multiplied by 1. So:
initial incorrect order:
0020
2000
now add 10000 and multiply by 1:
(10000  0020) * 1 = 9980
(10000  2000)* 1 = 8000
This leads to correct ordering:
2000 8000
0020 9980
Thanks
Juan

3. Re: SORTING A NUMERIC FIELD AS TEXT
juandent Oct 29, 2015 11:08 AM (in response to rgordon)Is there a function in FM14 that returns a string of N ceros?