2

I have a field with the following possible values:

"1-4","5-9","10-16","16+"

This is the order I want them to appear in a matrix report. But they appear in this order: "1-4","10-16","16+","5-9"

enter image description here

Because they are text and are sorted as text. How do I fix this?

Edited to add a picture.

2
  • Is that possible to make formula with type of number and sort by that field? – kurunve Dec 8 '16 at 16:25
  • I can "bucket" the field, but then what's the point of having the summary field in the first place? I want to have this field easily available for all report generators, with one definition, not one that's created "on the fly". – EdithCox Dec 8 '16 at 16:30
2

There's no way to define a custom sort function for standard SFDC reporting. First solutions that come to mind are:

  1. Edit the picklist values to better suit the alphabetical sort, like:
    • A 1-5
    • B 5-10
    • C 10+
  2. Rely on a formula field to customize your sorting, and then use this second field for your reports.
5
  • 1
    It is a formula field, based on the actual number in the field. Do I still need to edit the values to be alphabetical? – EdithCox Dec 8 '16 at 16:51
  • Then why not sort by the original number field? – Luca T Dec 8 '16 at 16:57
  • That field isn't on the report and I don't want to add it. It's a matrix report, I want to summarize by it. – EdithCox Dec 8 '16 at 17:28
  • Tweaking values in the formula to look like '01 - 05' and '05 - 09' should allow to sort it correctly – o-lexi Dec 8 '16 at 22:55
  • I'm marking this answered. Really the answer is we have to change the category names, or not use them. – EdithCox Dec 9 '16 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.