Forum Discussion
Anonymous
5 years agoNot applicable
Extract Using Any Non-Number As Delimiter
Hi. I am trying to extract numbers that only exist before any characters occur in the string. Once ANY characters start, that will be the end of the number. The trick here is that somtimes there are ...
- Anonymous5 years ago
= Table.AddColumn(#"Modificato tipo", "Personalizzato", each try Number.From(Splitter.SplitTextByCharacterTransition({"0".."9"}, (c) => c <"0" or c>"9")([Source]){0}) otherwise 1) - 5 years ago
Anonymous , you need to add a new column this way in your senario,
CNENFRNL
5 years agoCommunity Champion
Hi, Anonymous , you might want try a simple solution
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjZQitWJVjIxcATThkY6ps4+QWC2o5MzjDY0MlaKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Source = _t]),
#"Added Custom" = Table.AddColumn(Source, "Extracted", each let str = List.First(Text.SplitAny([Source],Text.Remove([Source],{"0".."9"}))) in if str="" then 1 else Number.From(str))
in
#"Added Custom"
Anonymous
5 years agoNot applicable
Hi CNENFRNL . Thanks for replying. When I create a new column with this code, it looks like my table turns into the exact image you provided. I do not need those exact values as they are examples to show the different scenarios of values I would need to convernt.
- CNENFRNL5 years agoCommunity Champion
Anonymous , you need to add a new column this way in your senario,