Forum Discussion
Kagliostro
1 year agoFrequent Visitor
Sort text in a single cell
Hi everyone, I am would like to sort out text in a single cell and to do so I found in this forum a script in M which would fit perfectly with my need (link). However, while the majority of cells wo...
- 1 year ago
There shouldn't be an error, but try this code anyway
=[ f = (x) => Text.Combine(List.Sort(List.Transform(Text.Split(x, ","), Text.Trim)), ","), Split = try f([NAME_ASSIGNED]) otherwise [NAME_ASSIGNED] ][Split]
ronrsnfld
1 year agoSuper User
If your NAME_ASSIGNED column contains various text strings, I'm surprised your code works at all. Your last line reads:
if List.Count([NAME_ASSIGNED],",") > 1 then Combine
else [NAME_ASSIGNED]
which should always result in an error if NAME_ASSIGNED contains text strings.
What is actually in that column, and what is your error message.