• Resolved coopeh1

    (@coopeh1)


    I have a table with names and addresses. The address is made up of two columns within the table. One column (No.) lists the street number. The 2nd column lists the street name (StreetName). Because the street number column values are actually text the column does not sort as expected. example: 101 lists before 30.
    How do I make the street number column values numerical?
    Also how do I indicate a specific sort order of the two columns? Street name first then street number.
    I have tried to read the related articles but would appreciate some help.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    This indicates that your column is not actually fully numeric. Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Thread Starter coopeh1

    (@coopeh1)

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for the link.

    I’m a bit confused though. I don’t see any sorting problems with the street numbers. What do I need to do in order to reproduce the issue?

    Regards,
    Tobias

    Thread Starter coopeh1

    (@coopeh1)

    I would like to sort the table by two columns: first by street name; then second sort by street number (2nd sort of the previous sort) so that the list looks like the following:

    1 Spruce Rd
    2 Spruce Rd
    3 Spruce Rd
    5 Spruce Rd
    11 Spruce Rd
    127 Spruce Rd
    2011 Spruce Rd
    Not like the following:

    1 Spruce Rd
    11 Spruce Rd
    127 Spruce Rd
    2 Spruce Rd
    2011 Spruce Rd
    3 Spruce Rd
    5 Spruce Rd

    Thanks for your help

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    to achieve that, you can first sort by “StreetName” (by clicking on that) and then, while holding down the “Shift” key, click on “No.”.

    To automatically get that sort order when the page with the table is opened, you can add this to the “Custom Commands” text field on the table’s “Edit” screen:

    "order": [ [ 2, "asc" ], [ 1, "asc" ] ]
    

    Regards,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘numerical sorting’ is closed to new replies.