I have a variable that contain list of items, items are ;-
year , category , value
2024, cap internal , 20
2024, cap external, 60
2024, cap material, 50
2025, exp internal , 20
2025, exp external , 30
2025, exp material , 40
I want to sort this like :-
Discussion posts and replies are publicly visible
a!localVariables( local!input: { { "2024, cap internal , 20", "2024, cap external, 60", "2024, cap material, 50", "2025, exp internal , 20", "2025, exp external , 30", "2025, exp material , 40" } }, local!dictionary: a!forEach( local!input, a!localVariables( local!itemVal: split(fv!item, ","), a!map( year: local!itemVal[1], category: local!itemVal[2], value: local!itemVal[3] ) ) ), local!sorted: todatasubset( local!dictionary, a!pagingInfo( 1, - 1, { a!sortInfo(field: "year", ascending: true()), a!sortInfo(field: "value", ascending: false()) } ) ).data, local!sorted )
For better readability