Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to sort data in decreasing order by year and display the result in concat.
I have tried using sort weight but it didn't work.
I have following data:
Year: 1992,2008
SchoolName,: XYZ,ABC
Desc: 123,456
respectively
concat(Year&' | '&SchoolName&' | '&Desc,chr(13)) as Education
results I want:
2008 | XYZ | 123
1992 | ABC | 456
Please guide on how to achieve this.
I have also tried sorting data before in temporary table
Hi,
did you try to with negative Year as sort weight to get a decreasing sort order?:
table1:
LOAD ID,
Concat(Year&' | '&SchoolName&' | '&Desc, Chr(13), -Year) as Education
Inline [
ID, Year, SchoolName, Desc
1, 1992, XYZ, 123
1, 2008, ABC, 456
2, 1993, WXY, 234
2, 2007, BCD, 567
2, 2001, CDE, 678
]
Group By ID;
hope this helps
Marco
How do you want to display it?
like this?
LOAD *, YEAR&'|'&SCHOOLNAME&'|'&DESC as CONCAT;
LOAD * INLINE [
YEAR, SCHOOLNAME, DESC
1992, XYZ, 123
2008, ABC, 456
];
2008|ABC|456 should be at top and then 1992|XYZ|123
So you can just sort it within the list box.
Hi,
did you try to with negative Year as sort weight to get a decreasing sort order?:
table1:
LOAD ID,
Concat(Year&' | '&SchoolName&' | '&Desc, Chr(13), -Year) as Education
Inline [
ID, Year, SchoolName, Desc
1, 1992, XYZ, 123
1, 2008, ABC, 456
2, 1993, WXY, 234
2, 2007, BCD, 567
2, 2001, CDE, 678
]
Group By ID;
hope this helps
Marco