Sort table with calculated expression not sorting correctly

Sort table with calculated expression not sorting correctly

  

So i have a table which is populated with data fetched using an SQL Query. A structure was created as an output entity for this query. In one of the columns, there's a calculated expression using 3 of the attributes from that structure with a MoneyFormat function wrapped around them to format in Euros. However, when i test the sorting for the column, some of the values aren't correctly sorted. For instance, when i sort it from largest to lowest, i noticed some negative values mixed among the larger ones. How can i fix this inconsistency?

Hi b_pal,

For starters, it would be useful if you would tell us how you do the sorting. Is it part of an Order By in the SQL, or do you sort afterwards e.g. with a ListSort?

Kilian Hekhuis wrote:

Hi b_pal,

For starters, it would be useful if you would tell us how you do the sorting. Is it part of an Order By in the SQL, or do you sort afterwards e.g. with a ListSort?

I sort it afterwards using a custom web block.


Hi b_pal,

I don't understand what you mean. Can you share an eSpace/OML that shows what you are doing?

Hi b_pal,

Since you are fetching the data through the SQL query, just make all your calculations in that query, and store that output in one of the structure's column and Alias it. Use that alias name for sorting.

are you sure it's inconsistent?


if it's a text-attribute then I think it's a correct order. (especially if you added the currency symbol)