18
Views
4
Comments
Sorting Aggregate attribute with special conditions
Question

Good Day Community 

I am developing a mobile application. I have an aggregate with a column named "Dog Types". The column contains multiple names and an "Others". I am trying to sort the column alphabetically with Others being the bottom of the aggregate once used on a list. 


The question is if there is a way to sort this alone or do I have to add an additional column that can be use as an additional sorting field.


Thank you for any inputs that will be received.  


mvp_badge
MVP
Rank: #133

Hi,

Many ways to handle above situation.but the easiest way to add additional custom column in aggregate and replace 'Other' to the last alphabet value like 'ZZ' so that it always come at the bottom and then apply sorting on this column.


please let us know in case anything.


Thanks

Hi Leonard,


I will suggest you use static entity to store DogTypes data as there will be certain content. For a static entity, we have order attribute in-built which can be used to sort your static entity data. Give the largest value in Order to "Others" record and sort your aggregate by Order, your will get your desired result. You can still add another sort if you want to sort the column in another way and still desired result will be preserved.

Hope it helps!


Sanjay