Forum Discussion
CallumJ
4 years agoFrequent Visitor
Multiple values against a single ID, how to create a column that checks and records.
I feel as though this is definitely answered elsewhere but I cannot find the words to search for it. Basically I have the table below: Doc ID Comment 111 Test 112 Test 111 Iden...
latimeria
Solution Specialist
4 years agoHi CallumJ ,
You can try this:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQ0VNJRCkktLlGK1QFxjVC5IFnPlNS8ksy0zNQi3GqwmhALAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Doc ID" = _t, Comment = _t]),
#"Grouped Rows" = Table.Group(Source, {"Doc ID"}, {{"Row", each _, type table [Doc ID=nullable text, Comment=nullable text]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each _[Row][Comment]),
#"Expanded Row" = Table.ExpandTableColumn(#"Added Custom", "Row", {"Comment"}, {"Comment"}),
#"Added Custom1" = Table.AddColumn(#"Expanded Row", "Check", each if List.Contains([Custom], "Identifier") then "Identifier" else "Fail"),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom1",{"Doc ID", "Comment", "Check"})
in
#"Removed Other Columns"
(copy and paste in a blank query)
CallumJ
4 years agoFrequent Visitor
Hi Latimeria,
I am unable to port the code directly into my Power Query as I have done quite a bit with the data (it is sensitive). I can duplicate the query and do this step by step, are you able to provide the steps to completing this?