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.
-
LOV label in Named Query
-
How we can set Dynamically changing Form field Description?
-
Is it possible to have a conditional survivorship rule based on a SemQL filter (akin to the filter on privileges)?
-
Where Do I View 2 Merged Records?
-
Show/hide an attribute in a form
-
Restrict access of attributes
-
Is it possible to manage visible/invisible value in List depend on user role??
-
Why am I unable to merge duplicates?
-
How are child records selected when parent records are manually merged?
-
Can the response from the API Call Response can be formatted differently in the JSON output?
See all 178 topics