Forum Discussion
Split Tags based values
- 6 years ago
Hello sirpentagon
I don't know in witch format do you have this tags. I tried to find a solution if every tag is a row from a single-column table.
let Source = #table ( {"Column1"}, { {"{""Name"":""Test"", ""CreatedBy"":""SuperAdmin""}"}, {"{""Build"":""001"", ""CreatedBy"":""SuperAdmin""}"}, {"{""Name"":""Test2"", ""CreatedBy"":""NormalUser""}"}, {"{""Name"":""Test"", ""CreatedBy"":""Admin"", ""CreatedOn"":""02012020""}"} } ), AddRecords = Table.AddColumn ( Source, "Records", (add)=> let ReplaceData = Text.Remove(add[Column1], {"{", "}", """"}), SplitRecords = Text.Split(ReplaceData, ","), ToTable = Table.FromList(SplitRecords, Splitter.SplitByNothing(), {"Name"}), SplitColumn = Table.SplitColumn(ToTable, "Name", Splitter.SplitTextByDelimiter(":"), {"Name", "Value"}), ToRecords = Record.FromTable(SplitColumn), TabelToRecords = Table.FromRecords({ToRecords}) in TabelToRecords ), Combine = Table.Combine ( AddRecords[Records] ) in CombineCopy paste this code to the advanced editor in a new blank query to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query.
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 sirpentagon
I don't know in witch format do you have this tags. I tried to find a solution if every tag is a row from a single-column table.
let
Source = #table
(
{"Column1"},
{
{"{""Name"":""Test"", ""CreatedBy"":""SuperAdmin""}"}, {"{""Build"":""001"", ""CreatedBy"":""SuperAdmin""}"}, {"{""Name"":""Test2"", ""CreatedBy"":""NormalUser""}"},
{"{""Name"":""Test"", ""CreatedBy"":""Admin"", ""CreatedOn"":""02012020""}"}
}
),
AddRecords = Table.AddColumn
(
Source,
"Records",
(add)=>
let
ReplaceData = Text.Remove(add[Column1], {"{", "}", """"}),
SplitRecords = Text.Split(ReplaceData, ","),
ToTable = Table.FromList(SplitRecords, Splitter.SplitByNothing(), {"Name"}),
SplitColumn = Table.SplitColumn(ToTable, "Name", Splitter.SplitTextByDelimiter(":"), {"Name", "Value"}),
ToRecords = Record.FromTable(SplitColumn),
TabelToRecords = Table.FromRecords({ToRecords})
in
TabelToRecords
),
Combine = Table.Combine
(
AddRecords[Records]
)
in
Combine
Copy paste this code to the advanced editor in a new blank query to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query.
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