Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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.