Forum Discussion
Anonymous
8 years agoNot applicable
Integer Extraction function returning Expression.Error Message
Through some research, I found this formula to extract numbers only to use in my queries. Since it is used often, I want to write a function from it. However, I can't seem to make it work properly. I...
- Anonymous8 years ago
Anonymous,
Please check the following code.let intextaction=(AlphaNumeric as text)=> let Source = Text.Combine(List.RemoveNulls(List.Transform(Text.ToList(""&AlphaNumeric&""),each if Value.Is(Value.FromText(_), type number) then _ else null))) in Source in intextaction
Regards,
Lydia
Anonymous
8 years agoNot applicable
Anonymous,
Please check the following code.
let intextaction=(AlphaNumeric as text)=>
let
Source = Text.Combine(List.RemoveNulls(List.Transform(Text.ToList(""&AlphaNumeric&""),each if Value.Is(Value.FromText(_), type number) then _ else null)))
in
Source
in
intextaction
Regards,
Lydia
- Anonymous8 years agoNot applicable
Lydia,
Thank you, this solved the problem. After looking closely, the List.Transform method requires an "each" statement (not sure if that's how you say it "each statement"?).
The AlphaNumeric variable can go in there without having any quotes or ampersands.