Jump to content
Salesforce and other SMB Solutions are coming soon. ×

How to reverse the values in a value list


Mariano Peterson

Recommended Posts

I need to create a calc that will output the items from a value list, but in reverse order. So, if the list has:

a

b

c

Then I need

c

b

a

Can anybody think of a way to do this, with a calculation?

 

Alternatively:

What I'm really after here is reverse sorting a custom list. I have a list UI with column headers; when a col header is clicked, the list is sorted (in asc order if its not the currently sorted col, otherwise if the col is already in asc order, then it gets switched to des order). The column I'm working with now has a custom sort based on a value list, which can change periodically. My real goal is to sort the column in reversed custom order.

 

Any thoughts?

Link to comment
Share on other sites

Mariano,

Its a good thing you asked for Ideas and not solutions. I have an idea but have not taken the time to ry it. Could you make a field that is a calculation which = ValueListItems and sort on that... both ways?

Link to comment
Share on other sites

Thanks Riley! Your idea got me thinking and led me to a solution:

 

I created a calc field, "sort" (number):

Position( 
  "¶" & ValueListItems( Status( CurrentFileName), "list" ) & "¶", 
  "¶" & field & "¶", 
  0, 
  1
)

I can then sort asc and des using the "sort" field, and it allows me to reverse the custom sort.

 

Thanks again! laugh.gif

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use