Forum Discussion
Spilt Column and create New Row
- 5 years ago
thats it I now have the data load the way I need, your awesome! v-yalanwu-msft
Hi, Mooihoek ;
You could modify it as follows:
1.custom column in power query
2.add conditional column
3.remove custom column and fill up custom1 coulmn
4.split column
5.remove empty rows
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtIBofw0Bdey1LwSpVidaCVDQxNLU0OgqJG5voGJvpGBEZgDpHQtdA3NwWpCIfrM3u+ZZWwc4KsUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Case Number" = _t, #"Date Submitted" = _t, #"Date/Time" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Case Number", type text}, {"Date Submitted", type date}}),
Custom1 = Table.AddColumn(#"Changed Type", "Custom", each Text.Select([Case Number],{"A".."z"})&"|"&[#"Date/Time"]),
#"Added Conditional Column" = Table.AddColumn(Custom1, "Custom.1", each if Text.StartsWith([Custom], "|") then null else [Custom]),
#"Removed Columns" = Table.RemoveColumns(#"Added Conditional Column",{"Custom"}),
#"Filled Up" = Table.FillUp(#"Removed Columns",{"Custom.1"}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Filled Up", "Custom.1", Splitter.SplitTextByDelimiter("|", QuoteStyle.Csv), {"Custom.1.1", "Custom.1.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Date/Time", type text}, {"Custom.1.1", type text}, {"Custom.1.2", type text}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type1", each [Date Submitted] <> null and [Date Submitted] <> "")
in
#"Filtered Rows"
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mooihoek5 years agoHelper II
thanks Yalan Wu, at 2.add conditional column I do not get an option to select "begins with' only equals or does not equal are available.
- v-yalanwu-msft5 years agoCommunity Support
Hi, Mooihoek ;
There is a drop-down box to choose.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Mooihoek5 years agoHelper II
thats it I now have the data load the way I need, your awesome! v-yalanwu-msft