Skip to main content
Announcements
Marching toward a simplified navigation! READ ON
cancel
Showing results for 
Search instead for 
Did you mean: 
sbfernandes
Contributor III
Contributor III

Sort data in a cell

Greetings! Is there any way to sort data in a cell (alphabetically). Eg: (attached pic) Contents of Col B is to be sorted individually.
1 Solution

Accepted Solutions
mrybalko
Creator II
Creator II

Data:
LOAD
	RowNo() as RowID,
	Unsorted
Inline [
Unsorted
'zebra,lion,tiger'
'oil,apple,butter'
];

tmp:
LOAD
	RowID,
	SubField(Unsorted, ',') as Values
Resident Data;

LEFT JOIN('Data')
LOAD
	RowID,
	Concat(Values, ',') as Sorted
Resident tmp
Group by RowID
Order by Values;

drop Table tmp;

View solution in original post

4 Replies
mrybalko
Creator II
Creator II

Hello @sbfernandes 

Do you need new column on data loading stage or just chart expression?

sbfernandes
Contributor III
Contributor III
Author

Hi Mrybalko

I require a new column in the loading stage.

Thanks.

mrybalko
Creator II
Creator II

Data:
LOAD
	RowNo() as RowID,
	Unsorted
Inline [
Unsorted
'zebra,lion,tiger'
'oil,apple,butter'
];

tmp:
LOAD
	RowID,
	SubField(Unsorted, ',') as Values
Resident Data;

LEFT JOIN('Data')
LOAD
	RowID,
	Concat(Values, ',') as Sorted
Resident tmp
Group by RowID
Order by Values;

drop Table tmp;
sbfernandes
Contributor III
Contributor III
Author

Hi Mrybalko,
Many thanks for this. Works perfectly.