{"action":"created","issue":{"url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/1451","repository_url":"https://api.github.com/repos/SparkDevNetwork/Rock","labels_url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/1451/labels{/name}","comments_url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/1451/comments","events_url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/1451/events","html_url":"https://github.com/SparkDevNetwork/Rock/issues/1451","id":143637352,"number":1451,"title":"Report lava field not sorting text numbers","user":{"login":"ElimAdmin","id":4658177,"avatar_url":"https://avatars.githubusercontent.com/u/4658177?v=3","gravatar_id":"","url":"https://api.github.com/users/ElimAdmin","html_url":"https://github.com/ElimAdmin","followers_url":"https://api.github.com/users/ElimAdmin/followers","following_url":"https://api.github.com/users/ElimAdmin/following{/other_user}","gists_url":"https://api.github.com/users/ElimAdmin/gists{/gist_id}","starred_url":"https://api.github.com/users/ElimAdmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElimAdmin/subscriptions","organizations_url":"https://api.github.com/users/ElimAdmin/orgs","repos_url":"https://api.github.com/users/ElimAdmin/repos","events_url":"https://api.github.com/users/ElimAdmin/events{/privacy}","received_events_url":"https://api.github.com/users/ElimAdmin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-26T00:35:20Z","updated_at":"2016-04-28T11:25:24Z","closed_at":"2016-04-28T11:25:24Z","body":"I am trying to sort a report on a text 'Giving Number' person attribute.  This contains numbers like \r\n2, 102, 202\r\nSorting on the text GivingNumber attribute field gives expected text sorting: \r\n![lavasort3](https://cloud.githubusercontent.com/assets/4658177/14056840/37960f1a-f356-11e5-96ec-d4555c62c2cb.JPG)\r\n\r\nI tried adding this lava field:  {{ GivingNumber | Plus: 0 }} and sorting on this.  This gives an unexpected and unsorted output:\r\n![lavasort1](https://cloud.githubusercontent.com/assets/4658177/14056752/35e4cc8e-f355-11e5-95d6-6dc529770bea.JPG)\r\n\r\nI tried sorting on this lava field: {{ '00000' | Truncate:4, GivingNumber }}.\r\nThis gives this output:\r\n![lavasort2](https://cloud.githubusercontent.com/assets/4658177/14056798/b8cdddde-f355-11e5-806c-2fbdf89d5304.JPG)\r\n\r\nIt seems the sorting is being done before the lava is being applied.\r\n\r\nIn general, there seems no way to be able to sort a number stored as text, or output as text from lava, to get a numeric sort order.  Is there any way to type the lava output as numeric?\r\n\r\nI can work around this by changing the type of the attribute to integer:  this allows the report to be sorted correctly on GivingNumber, so it's not a biggie.  (But this is not a permanent solution because I need the GivingNumber to be text for other reasons.)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/comments/215393517","html_url":"https://github.com/SparkDevNetwork/Rock/issues/1451#issuecomment-215393517","issue_url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/1451","id":215393517,"user":{"login":"azturner","id":548180,"avatar_url":"https://avatars.githubusercontent.com/u/548180?v=3","gravatar_id":"","url":"https://api.github.com/users/azturner","html_url":"https://github.com/azturner","followers_url":"https://api.github.com/users/azturner/followers","following_url":"https://api.github.com/users/azturner/following{/other_user}","gists_url":"https://api.github.com/users/azturner/gists{/gist_id}","starred_url":"https://api.github.com/users/azturner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azturner/subscriptions","organizations_url":"https://api.github.com/users/azturner/orgs","repos_url":"https://api.github.com/users/azturner/repos","events_url":"https://api.github.com/users/azturner/events{/privacy}","received_events_url":"https://api.github.com/users/azturner/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T11:25:24Z","updated_at":"2016-04-28T11:25:24Z","body":"@ElimAdmin , unfortunately there's not really an easy way to sort the lava fields in the reporting interface since the values are being formatted after the querying/sorting of the data. Because of that, we have updated the report block so that it only shows fields that can be sorted in the order by selection: https://github.com/SparkDevNetwork/Rock/commit/94b4550b7ed28303071fbab99609ef270283bbc4\r\n"}}