Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Use Text.Start function dynamically based on column name

Hey guys,

 

I'm working on a solution to dynamically applying the Text.Start function.

What I want to achieve is to pass the Level Number of the column name to the function:

 

= Table.TransformColumns(#"AddColumn",
List.Transform(ColumnNames,
each {_,each Text.Start(_, 3), type text}
))

 

 

Do you have any idea on how to get the value out of the column name and pass it to the function?

 

The expected result should look like this:

 

Thanks Dan

  • Use following formula

    = Table.TransformColumns(#"AddColumn",List.Transform(ColumnNames, (x)=> {x, each Text.Start(_,Number.From(Text.Select(x,{"0".."9"}))), type text}))

2 Replies

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Most Valuable Professional

    Use following formula

    = Table.TransformColumns(#"AddColumn",List.Transform(ColumnNames, (x)=> {x, each Text.Start(_,Number.From(Text.Select(x,{"0".."9"}))), type text}))