I have a calculated field on a custom form called "CalcPriScore"
That field is a sorted column on a report. It is string though, rather than numerical so it isn't sorting properly. How can that column to be sorted numerically instead?
I have this text mode for the CalcPriScore (Prioritization Score) column:
displayname=Prioritization Score (max 30)
linkedname=direct
namekey=CalcPriScore
querysort=DE:CalcPriScore
sortOrder=1
sortType=desc
textmode=true
valueexpression=ROUND({DE:CalcPriScore},1)
valuefield=CalcPriScore
valueformat=customDataLabelsAsString
I tried valueformat=Int, but that didn't work either.
As you can see in the screenshot of the prioritization score column from my report, the top item is rated 9.5 and is at the top because 9 is greater than 2 when a string, vs looking at 9.5 vs 22.7 as numbers.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Hi Cathy,
I still occasionally catch myself in such situations, where I've neglected to change the datatype on a calculated column from the default "Text" to the proper datatype (e.g. Number, in your case). Provided data has not yet been entered, Workfront allows the datatype to be changed...but once data exists, the datatype cannot be changed.
To change it (which although painful, is usually the best answer, and would solve your problem), I typically:
If, for some reason, you cannot or prefer not to do likewise, you could instead try wrapping your existing original parameter with the NUMBER keyword to convert it into a number, which might then also sort it numerically (untested)...but I have a suspicion that the querysort (which controls sorting) will still treat it as string.
Regards,
Doug
Hi Cathy,
I still occasionally catch myself in such situations, where I've neglected to change the datatype on a calculated column from the default "Text" to the proper datatype (e.g. Number, in your case). Provided data has not yet been entered, Workfront allows the datatype to be changed...but once data exists, the datatype cannot be changed.
To change it (which although painful, is usually the best answer, and would solve your problem), I typically:
If, for some reason, you cannot or prefer not to do likewise, you could instead try wrapping your existing original parameter with the NUMBER keyword to convert it into a number, which might then also sort it numerically (untested)...but I have a suspicion that the querysort (which controls sorting) will still treat it as string.
Regards,
Doug
Perfect solution, @Doug Den Hoed‚! Once again, thank you for your help. My report is functioning as intended now. 🙌
Views
Replies
Total Likes
Views
Likes
Replies