Showing results for 
Search instead for 
Did you mean: 

Concatenated List sorting

0 Kudos

I have a table with a Location, Country, Year, Month, and Total(Integer).

I need to create a concatenated list of all of the countries per location, with the total.

The intended final product would look like this:

Year Location Month Countries

2023 SPW October Mexico(14), Honduras(9), Canada(1), Colombia(1)

I can concatenate the list already, to include the totals, but the order is in descending Alphabetical Order:

I am using the following Variables:




=[CONCAT_CITIZENSHIP] Where([Subject Citizenship Code]=[MAX_CITIZENSHIP])


=[Subject Citizenship Code] + " (" + [TOTAL] + ")" + ", " + Previous(Self)


=Max([Subject Citizenship Code]) In ([Fiscal Year];[Sector];[Month])

I realize the CONCAT_CITIZENSHIP variable is what is sorting the list of citizenships in ascending order.

Also that the MAX_CONCAT_CITIZENSHIP variable is what "stops" the concatenation list at the correct point.

What I can't seem to figure out is if there is a way to sort the final list by the Totals in descending order, and ideally if there is a tie, to then sort alphabetically.

I realize that this may not be possible, but I thought I would ask. Thanks.

Community Manager
Community Manager
0 Kudos

Hello Tyler,

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with, as it provides tips for preparing questions that draw responses from our members.

Feel free to take our Q&A tutorial at as well, as that will also help you when preparing questions for the community.

By adding a picture to your profile you encourage your readers to respond.

Kind regards,

Accepted Solutions (0)

Answers (0)