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
H
Hitha Kishore
said
over 1 year ago
How to Implement Custom Multi-Attribute Sort
• SemQL supports SQL-like ORDER BY expressions, including CASE statements and multi-column sorts6.
• You can define this custom sort in the Sort Expression property of a business view, collection, or reference picker.
• The SemQL syntax for your requirement would look like:
CASE
WHEN AttributeA = 'A' THEN 0
WHEN AttributeA = 'B' THEN 1
ELSE 2
END ASC,
AttributeB DESC,
AttributeC DESC
This will sort first by your custom logic on AttributeA, then by AttributeB descending, then by AttributeC descending.
Where to Apply
• In a Business View: Go to the view’s configuration, enable Customized Sort, and enter your sort expression in the Sort Expression field4.
• In a Stepper or Reference Picker: Under the collection or picker configuration, enable Customized Sort and provide the SemQL sort expression5.
• In a Transition: If the transition displays a collection, you can also apply the sort expression there.
1 Comment
H
Hitha Kishore
said
over 1 year ago
Answer
How to Implement Custom Multi-Attribute Sort
• SemQL supports SQL-like ORDER BY expressions, including CASE statements and multi-column sorts6.
• You can define this custom sort in the Sort Expression property of a business view, collection, or reference picker.
• The SemQL syntax for your requirement would look like:
CASE
WHEN AttributeA = 'A' THEN 0
WHEN AttributeA = 'B' THEN 1
ELSE 2
END ASC,
AttributeB DESC,
AttributeC DESC
This will sort first by your custom logic on AttributeA, then by AttributeB descending, then by AttributeC descending.
Where to Apply
• In a Business View: Go to the view’s configuration, enable Customized Sort, and enter your sort expression in the Sort Expression field4.
• In a Stepper or Reference Picker: Under the collection or picker configuration, enable Customized Sort and provide the SemQL sort expression5.
• In a Transition: If the transition displays a collection, you can also apply the sort expression there.
Vinoth KUMAR C
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
How to Implement Custom Multi-Attribute Sort
• SemQL supports SQL-like ORDER BY expressions, including CASE statements and multi-column sorts6.
• You can define this custom sort in the Sort Expression property of a business view, collection, or reference picker.
• The SemQL syntax for your requirement would look like:
This will sort first by your custom logic on AttributeA, then by AttributeB descending, then by AttributeC descending.
Where to Apply
• In a Business View: Go to the view’s configuration, enable Customized Sort, and enter your sort expression in the Sort Expression field4.
• In a Stepper or Reference Picker: Under the collection or picker configuration, enable Customized Sort and provide the SemQL sort expression5.
• In a Transition: If the transition displays a collection, you can also apply the sort expression there.
Hitha Kishore
How to Implement Custom Multi-Attribute Sort
• SemQL supports SQL-like ORDER BY expressions, including CASE statements and multi-column sorts6.
• You can define this custom sort in the Sort Expression property of a business view, collection, or reference picker.
• The SemQL syntax for your requirement would look like:
This will sort first by your custom logic on AttributeA, then by AttributeB descending, then by AttributeC descending.
Where to Apply
• In a Business View: Go to the view’s configuration, enable Customized Sort, and enter your sort expression in the Sort Expression field4.
• In a Stepper or Reference Picker: Under the collection or picker configuration, enable Customized Sort and provide the SemQL sort expression5.
• In a Transition: If the transition displays a collection, you can also apply the sort expression there.
-
Extend a model with new entities or attributes
-
Data types in xDM
-
Effective date on entities
-
Search using wild cards
-
Export a model from production and import on a development environment
-
"Allow Delete" vs "Allow Removal" privileges
-
LOV label in Named Query
-
Select location on a map and save coordinates
-
Is there a way to set up a master-detail relationship on browse mode?
-
Choose Either a Stepper or A Workflow Based on The User Privileges
See all 346 topics