Forum Discussion
Anonymous
3 years agoNot applicable
Text.PositionOfAny
I'm using the text function "Text.PositionOfAny([Assistência], {"S"}, Occurrence.All)" to get the sequence of S from a string field. This is the string field "NNNNNNNNNSNNSNNNNNNNNNNNNNNNNNNNNNN...
- 3 years ago
Hi,
This M code works
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Added Custom" = Table.AddColumn(Source, "Custom", each List.Transform(Text.PositionOf([Text], "S", Occurrence.All), each Number.From(_) + 1)), #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), "-"), type text}) in #"Extracted Values"Hope this helps.
Ashish_Mathur
3 years agoSuper User
Hi,
This M code works
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Custom", each List.Transform(Text.PositionOf([Text], "S", Occurrence.All), each Number.From(_) + 1)),
#"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), "-"), type text})
in
#"Extracted Values"
Hope this helps.
Anonymous
3 years agoNot applicable
Ashish_Mathur Thank you for your help,
The step where I do this validation I cannot call the source, in the previous step I make a line filter, as I adapted the source to start the previous step,
Solution
List.Transform(Text.PositionOf([Assistência], "S", Occurrence.All), each Number.From(_) + 1)
- Ashish_Mathur3 years agoSuper User
I cannot understand your message.