Forum Discussion

rpiboy_1's avatar
rpiboy_1
Helper V
3 years ago
Solved

Combine Text from one column in Table.TransformColumns

Let us say we have a table like such:

Group CodeSub group Code
10null
1010
1020
20null
2010
2020
2030

 

In the table I want to transform the column [Sub group Code] in place, so that I get the following result:

Group CodeSub group Code
10null
1010_10
1010_20
20null
2020_10
2020_20
2020_30

 

I'm trying to use:

 

 

 

 

= Table.TransformColumns(#"PreviousStep", {{"Sub group Code", each Record.Field(_, "Group Code") & "_" & Text.From(_, "en-US"), type text}})

 

 

 

 

But it throws an error "We cannot apply field access to the type Text". I always seem to struggle with being in the right context for '_' so I'm quite certain my issue is around getting the value from the column 'Group Code'. Suggestions appreciated, explanation always helpful!

I realize I'll need some conditional logic for retaining the null state, but I don't think that is where my issues is?

3 Replies