Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I have column A, with many letters separated by a comma. I want a new column B, where i sort column A alphabetically.
See example Fig 1
Fig 1
Column A | Column B |
A,B,C | A,B,C |
B,C,A | A,B,C |
A,C,B | A,B,C |
B,A,C | A,B,C |
B,C,D | B,C,D |
D,A,C | A,C,D |
C,E,A | A,C,E |
Can anyone help me with a code for this?
Solved! Go to Solution.
Hi @Vendelin
please try
ColumnB =
VAR String = 'Table'[ColumnA]
VAR Items =
SUBSTITUTE ( String, ",", "|" )
VAR Length =
COALESCE ( PATHLENGTH ( Items ), 1 )
VAR T1 =
GENERATESERIES ( 1, Length, 1 )
VAR T2 =
SELECTCOLUMNS ( T1, "@Item", PATHITEM ( Items, [Value] ) )
RETURN
CONCATENATEX ( T2, [@Item], ",", [@Item], ASC )
Thanks tamerj1 it work perfekt 🙂
Hi @Vendelin
please try
ColumnB =
VAR String = 'Table'[ColumnA]
VAR Items =
SUBSTITUTE ( String, ",", "|" )
VAR Length =
COALESCE ( PATHLENGTH ( Items ), 1 )
VAR T1 =
GENERATESERIES ( 1, Length, 1 )
VAR T2 =
SELECTCOLUMNS ( T1, "@Item", PATHITEM ( Items, [Value] ) )
RETURN
CONCATENATEX ( T2, [@Item], ",", [@Item], ASC )
User | Count |
---|---|
12 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
11 | |
7 |