In which way we can sort the list items names and suggest me in an optimized way which wont increase the model size.
Thanks in advance!!
My suggestion is to create a module with that list and create one line item with "Text" formatted and bring in the Name into that line item by writing Name(Item('')) if it is a normal list or Display Name.List if it is a numbered list. Then put Sorting on the above created line item either in Ascending or Descending order based on your requirement. Please have a quick look at the below screen shot.
Sorting based on Line item "Name"
Let me know if you want any clarifications.
Try it in this way.
Step 1: Create a List called "Alphabetical Order" and create all the 26 characters as a list items with code starts from 0 to 26. ( Note :This will be a one time actvity) You can use this for any list that needs to be sorted.
Step 2: Create a line item in your module(Would always prefer because of Model performance and don't create properties) and it should be number formatted. The module should have the dimension of the list that you needs to get it sorted. Then write the below formula and sort that accordingly (Basically create relation between your list and Alph.. List and convert that to number) .
So in this way you can do your sorting permemantly without any increase in Model size as well. You can use that list "Alphabetaical Order" for whatever list that you want to sort.
Thanks and let me know if you have any concerns. I hope this would be helpful!! :)
I like the idea and it works neatly if you want it "loosely" sorted on alphabetical order.
However, in this solution, there's no "ranking bias" given to the second (and third, fourth etc.) letters - Sri Lanka appears above Sri Lanka.
I'm looking to get my head around a similar solution, but for alphanumerical list items (account IDs - "AC12354" etc.).
Does anyone have a thought on this?
You can add more formulas like this to rank to 3 letters:
VALUE(CODE(FINDITEM(Alpha Order, LEFT(Unique Employee.EmployeeName[LOOKUP: Employee Name], 1))) & CODE(FINDITEM(Alpha Order, MID(Unique Employee.EmployeeName[LOOKUP: Employee Name], 2, 1))) & CODE(FINDITEM(Alpha Order, MID(Unique Employee.EmployeeName[LOOKUP: Employee Name], 3, 1)))) / 100
For performance, please split those component parts out into separate line items
Unique Employee.EmployeeName[LOOKUP: Employee Name] is repeated 3x
and you should split the parameters of the FINDITEM into separate line items too
you said to repeat Unique Employee.EmployeeName[LOOKUP: Employee Name] x 3 times.
This formula will provide the same results 3 times so why do I need to do 3 times?
sorry for the confusion, I meant because it is repeated 3x in the formula, it should be split out into a single line item