Forum Discussion
Replace numeric values with NULL in power query
- 5 years ago
Hello Damian89
the simplest way to remove numbers is to use Text.Remove and indicating 0 - 9 in the second parameter
Text.Remove(text,{"0".."9"})Here a complete example where I included this function into a Table.TranformColumns. You can also create a new column.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Pcy7CQAhEATQVpaNjY792IsYCLqBXiZcaTZgY6cGZjOPYULAOXrLVh2knm2OxkKQNr5LiTC6gMIkJPDsSU+WD+7ivedbipUPllxQPVFVmfn8Y4w/", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Table1 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Table1", type text}}), GetRidOfNumber = Table.TransformColumns ( #"Changed Type", { { "Table1", (text)=> Text.Remove(text,{"0".."9"}) } } ) in GetRidOfNumberCopy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hello Damian89
the simplest way to remove numbers is to use Text.Remove and indicating 0 - 9 in the second parameter
Text.Remove(text,{"0".."9"})
Here a complete example where I included this function into a Table.TranformColumns. You can also create a new column.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Pcy7CQAhEATQVpaNjY792IsYCLqBXiZcaTZgY6cGZjOPYULAOXrLVh2knm2OxkKQNr5LiTC6gMIkJPDsSU+WD+7ivedbipUPllxQPVFVmfn8Y4w/", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Table1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Table1", type text}}),
GetRidOfNumber = Table.TransformColumns
(
#"Changed Type",
{
{
"Table1",
(text)=> Text.Remove(text,{"0".."9"})
}
}
)
in
GetRidOfNumber
Copy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
It works perfectly 😃