Start a new topic
Answered

Custom Sort Options

Hi All,


I am looking for options to apply a custom sort based on 3 different Attributes values, am expecting the sort to work as expected, like first sort on Attribute 1 ASC,  then Attribute B DESC and then Attribute C DESC.


The sort condition is like mentioned below,

CASE  WHEN Attribute A= 'A' then 0

WHEN Attribute A = 'B' then 1

else 2

END

ASC,

Attribute B DESC,

Attribute C DESC


Could some help and share thoughts if the above custom condition can be applied on a transition in a business view or any other option to get this achieved in Semarchy. Appreciate your suggestions.


Thanks

Vinoth


Best Answer

You can define a custom sort on your business view, in the property tab > collection configuration:


There you will be able to define your semql sort expression, which will have a similar structure as an sql expression. In your situation it’ll look like:

CASE 
  WHEN AttributeA = 'A' THEN 0
  WHEN AttributeA = 'B' THEN 1
  ELSE 2
END ASC,
AttributeB DESC,
AttributeC DESC 




1 Comment

Answer

You can define a custom sort on your business view, in the property tab > collection configuration:


There you will be able to define your semql sort expression, which will have a similar structure as an sql expression. In your situation it’ll look like:

CASE 
  WHEN AttributeA = 'A' THEN 0
  WHEN AttributeA = 'B' THEN 1
  ELSE 2
END ASC,
AttributeB DESC,
AttributeC DESC 




Login to post a comment