Hi,

By default i need to sort records in descending order how can i achive this?

there is one attribute called ID in the table ,

ID : 23,787,87,1,9,11111111

expected output should be like this

ID :  11111111,787,87,23,9,1

Ronan T wrote:

Hi,

By default i need to sort records in descending order how can i achive this?

there is one attribute called ID in the table ,

ID : 23,787,87,1,9,11111111

expected output should be like this

ID :  11111111,787,87,23,9,1

Hi Ronan T,

You can add sort in your aggregate and select the attribute which you want and set the type to descending.

Hope this works for you!!


Priya Khade wrote:

Ronan T wrote:

Hi,

By default i need to sort records in descending order how can i achive this?

there is one attribute called ID in the table ,

ID : 23,787,87,1,9,11111111

expected output should be like this

ID :  11111111,787,87,23,9,1

Hi Ronan T,

You can add sort in your aggregate and select the attribute which you want and set the type to descending.

Hope this works for you!!


Hi Priya,

I have tried , but it is giving like this,

9,87,787,23,11111111 ,1



Ronan T wrote:

Priya Khade wrote:

Ronan T wrote:

Hi,

By default i need to sort records in descending order how can i achive this?

there is one attribute called ID in the table ,

ID : 23,787,87,1,9,11111111

expected output should be like this

ID :  11111111,787,87,23,9,1

Hi Ronan T,

You can add sort in your aggregate and select the attribute which you want and set the type to descending.

Hope this works for you!!


Hi Priya,

I have tried , but it is giving like this,

9,87,787,23,11111111 ,1



Hi,

Can you share the oml


Priya Khade wrote:

Ronan T wrote:

Priya Khade wrote:

Ronan T wrote:

Hi,

By default i need to sort records in descending order how can i achive this?

there is one attribute called ID in the table ,

ID : 23,787,87,1,9,11111111

expected output should be like this

ID :  11111111,787,87,23,9,1

Hi Ronan T,

You can add sort in your aggregate and select the attribute which you want and set the type to descending.

Hope this works for you!!


Hi Priya,

I have tried , but it is giving like this,

9,87,787,23,11111111 ,1



Hi,

Can you share the oml


Hi Priya,

sorry i can not share the oml,

if u have not understand my question, please refer excepected ouput


Hello 

Have you tried something like the below in your aggregate ?



Hello 

It appears your attribute is of type text and it is sorting on text as expected. 

Hi 

You can achieve your desc sort by adding a custom column and converting your text to int and then sort on that column. See attached screenshot. 

Amal Raj wrote:

Hi 

You can achieve your desc sort by adding a custom column and converting your text to int and then sort on that column. See attached screenshot. 

Hi Amal Raj ,

Working fine but after clicking on the completed, it has to give ascending as well no!!

please find the attached file


Hi 

You have to add a dynamic sort 

The easiest way is to scaffold a list screen for your entity and see how the dynamic sorting is implemented. 


Check out the below post 

https://www.outsystems.com/forums/discussion/18794/dynamic-sort-on-an-aggregation/



Amal Raj wrote:

Hi 

You have to add a dynamic sort 

The easiest way is to scaffold a list screen for your entity and see how the dynamic sorting is implemented. 


Check out the below post 

https://www.outsystems.com/forums/discussion/18794/dynamic-sort-on-an-aggregation/



Hi amar,

if i add dynamic sort this is how getting results.


please find the attached file


SyntaxEditor Code Snippet

List_SortColumn_GetOrderBy(PeopleTable.Id,DefaultOrder:"{people}.[completed] DESC ")


Hi Ronan,

Can't you change the completed type from text to int? I would simplify a lot your life. 

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Ronan,

Can't you change the completed type from text to int? I would simplify a lot your life. 

Regards,

Marcelo

Hi Marcelo,

No,that is our requirement


Hi 

How about adding a computed column ( integer) and work with that for sorting. 

Hi Ronan,

Yes You can still achieve the desired output,

All you need to do is , 

1. Create computed column:

2. Add dynamic sort to the aggregate:


3. Change the sort column property to computed column Id:

Try this out.

This should work for you.


Regards,

Waseema.

Waseema wrote:

Hi Ronan,

Yes You can still achieve the desired output,

All you need to do is , 

1. Create computed column:

2. Add dynamic sort to the aggregate:


3. Change the sort column property to computed column Id:

Try this out.

This should work for you.


Regards,

Waseema.

Hi,

Could you share the oml.


Solution

Ronan T wrote:

Waseema wrote:

Hi Ronan,

Yes You can still achieve the desired output,

All you need to do is , 

1. Create computed column:

2. Add dynamic sort to the aggregate:


3. Change the sort column property to computed column Id:

Try this out.

This should work for you.


Regards,

Waseema.

Hi,

Could you share the oml.


PFA-


Solution

Waseema wrote:

Ronan T wrote:

Waseema wrote:

Hi Ronan,

Yes You can still achieve the desired output,

All you need to do is , 

1. Create computed column:

2. Add dynamic sort to the aggregate:


3. Change the sort column property to computed column Id:

Try this out.

This should work for you.


Regards,

Waseema.

Hi,

Could you share the oml.


PFA-


Hi Waseema,

Thank you ,it is working now



Waseema wrote:

Hi Ronan,

Yes You can still achieve the desired output,

All you need to do is , 

1. Create computed column:

2. Add dynamic sort to the aggregate:


3. Change the sort column property to computed column Id:

Try this out.

This should work for you.


Regards,

Waseema.


Waseema, 

Is it possible to have dynamic sort on column that is not derived? Or is the fact that it's derived as part of the aggregate (not the table per-se) why this works when "{table}.[column] DESC" doesn't? 

Thanks, 

Scott 

... "{table}. [Column] desc")  works