Forum Discussion
Creating a column with 2 others
- 2 years ago
try creating a custom column, something like
= if Text.BeforeDelimiter([YourColumnName], "_") > Text.AfterDelimiter([YourColumnName], "_") then Text.AfterDelimiter([YourColumnName], "_") & "_" & Text.BeforeDelimiter([YourColumnName], "_") else [YourColumnName]
Replace [YourColumnName] with the name of your column that has the "A_B" or "B_A" values.
Before you create the "A_B" column, you should make sure that the two companies are sorted alphabetically. This will ensure that the concatenation is consistent.
For example in PQ editor,
Text.Combine(List.Sort({[CompanyA], [CompanyB]}), "_")
rubayatyasmin Yes it's already sorted alphabetically.
It's logical that i have both "A_B" and "B_A" because in the colum Company i have both A and B.
However what i'm willing to do is to reunite "A_B" and "B_A" to only "A_B".
- rubayatyasmin2 years agoCommunity Champion
try creating a custom column, something like
= if Text.BeforeDelimiter([YourColumnName], "_") > Text.AfterDelimiter([YourColumnName], "_") then Text.AfterDelimiter([YourColumnName], "_") & "_" & Text.BeforeDelimiter([YourColumnName], "_") else [YourColumnName]
Replace [YourColumnName] with the name of your column that has the "A_B" or "B_A" values.