Desconsider characters when sorting column

Desconsider characters when sorting column

quinhoboozquinhobooz Posts: 12Questions: 3Answers: 0

I have a column with amounts that comes wish currency tag (USD, EUR and BRL) and when sorting the column it does not work.

https://jsfiddle.net/goy0reun/1/

What do I need to do to avoid those currency tags plus the space ('USD ')

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954

    Use Orthogonal data to remove the currency tag and spaces for the filter operation.

    Kevin

  • quinhoboozquinhobooz Posts: 12Questions: 3Answers: 0

    Hi Kevin,

    I did, but I'm probably doing something wrong cause still not sorting correctly.
    See below:

    https://jsfiddle.net/j0ufm321/3/

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954
    Answer ✓

    Close. You will need to more modifications to have the value sorted as a number. Like this:
    https://jsfiddle.net/tnwbdk4g/

    The 12.785,76 will need to look like 12785.76 for numeric sorting. First remove the periods then change the comma to period. Lastly use trim() to remove the white space. Since you are changing the data type from string to numeric you also need to apply this change to the type detection operation.

    Kevin

  • quinhoboozquinhobooz Posts: 12Questions: 3Answers: 0

    I Got close to that, forgot the trim() function.. Thank you so much!!

Sign In or Register to comment.