Sorting a numeric column with string data
If I have a column with numbers and some of the rows only has "n/a" the sort order of that column is not performed correctly. Example:
RANK WebSite
---------------
9 sitea.com
3 siteb.com
n/a sitec.com
7 sited.com
When I order by the RANK column the sort order becomes wrong. One possible solution to correct this would be to force the sort method of the column.
In the example you could have some instruction to say that the order of RANK column is "numeric" and any value in that column that is not a number would be a high number or blank, in order to sort it correctly.
For example: If I had an instruction to say that the RANK column is to be sorted in numeric format and any value on that column that is not a number would be treated as if it had the value of 999999, the sort order would be perfect. As the value is "n/a" (not available) it would be the last in an ascending order or the first in a descending order.
Carlos
RANK WebSite
---------------
9 sitea.com
3 siteb.com
n/a sitec.com
7 sited.com
When I order by the RANK column the sort order becomes wrong. One possible solution to correct this would be to force the sort method of the column.
In the example you could have some instruction to say that the order of RANK column is "numeric" and any value in that column that is not a number would be a high number or blank, in order to sort it correctly.
For example: If I had an instruction to say that the RANK column is to be sorted in numeric format and any value on that column that is not a number would be treated as if it had the value of 999999, the sort order would be perfect. As the value is "n/a" (not available) it would be the last in an ascending order or the first in a descending order.
Carlos
December 19,