I have a report where I'm trying to sort by an Amendment Number. It seems to always be sorting by string only no matter what type I set the datasource to
For some reason, the output when I sort by ascending is showing up as:
100000
11
12
13
14
15
7
8
9
Instead of:
7
8
9
11
12
13
14
15
100000
Not Sorting By Numbers Correctly
Not Sorting By Numbers Correctly
- Attachments
-
- Report.mrt
- (26.34 KiB) Downloaded 71 times
-
- Screen Shot 2024-04-05 at 6.06.47 PM.png (434.92 KiB) Viewed 1324 times
Last edited by ericp on Sun Apr 07, 2024 3:39 am, edited 1 time in total.
Re: Not Sorting By Numbers Correctly
Also attached my sample report.
I ensured that the type of my source is changed to INT, but it still seems to be sorting by String.
I ensured that the type of my source is changed to INT, but it still seems to be sorting by String.
-
- Posts: 6358
- Joined: Tue Mar 20, 2018 5:34 am
Re: Not Sorting By Numbers Correctly
Hello,
Please send us a sample report with test data for analysis.
Thank you.
Please send us a sample report with test data for analysis.
Thank you.
Re: Not Sorting By Numbers Correctly
Hi Lech, please see the attached-
- Attachments
-
- Report.mrt
- (16.39 KiB) Downloaded 62 times
-
- Posts: 6358
- Joined: Tue Mar 20, 2018 5:34 am
Re: Not Sorting By Numbers Correctly
Hello,
In your JSON, your column is stored as a string:
"Amendment#": "7"
for numeric should be:
"Amendment#": 7
Also, in your report you can use the following expression for sorting:
(decimal)(Projects.Amendment_)
Thank you.
In your JSON, your column is stored as a string:
"Amendment#": "7"
for numeric should be:
"Amendment#": 7
Also, in your report you can use the following expression for sorting:
(decimal)(Projects.Amendment_)
Thank you.
Re: Not Sorting By Numbers Correctly
Hey Lech, I tried using both (Decimal)(Projects.Amendment_) and {(Decimal)(Projects.Amendment_)}, but it still doesn't seem to be formatting properly.
As for the decimal you can see that i changed the type to decimal- doesn't that automatically make the "Amendment#" turn into 7 instead of "7"?
Are you able to send the report of it working? Thanks!
As for the decimal you can see that i changed the type to decimal- doesn't that automatically make the "Amendment#" turn into 7 instead of "7"?
Are you able to send the report of it working? Thanks!
- Attachments
-
- Screen Shot 2024-04-08 at 9.23.18 AM.png (22.16 KiB) Viewed 1231 times
-
- Screen Shot 2024-04-08 at 9.22.53 AM.png (437.13 KiB) Viewed 1231 times
-
- Posts: 6358
- Joined: Tue Mar 20, 2018 5:34 am
Re: Not Sorting By Numbers Correctly
Hello,
Please check the modified report.
Thank you.
Please check the modified report.
Thank you.
- Attachments
-
- Report_modified.mrt
- (16.83 KiB) Downloaded 58 times