Forum Discussion
Anonymous
6 years agoNot applicable
Getting the earliest modified Date
Hi, I have a file that lists the Field Ticket Number and Modified Date. I would like to create a new field called FirstModifiedDate. One ticket number can have multiple line items: Ticket# ...
- 6 years ago
Hi Anonymous ,
We can use group for one time and then expand the result to meet your requirement:
All the quries are here:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrQwNDI2UdJRMjTSN9U3MjC0VIrVQRU2wS6MrtoUrzC6IVBhY6hwLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Ticket#" = _t, ModifiedDate = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Ticket#", Int64.Type}, {"ModifiedDate", type date}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Ticket#"}, {{"Data", each _, type table [#"Ticket#"=number, ModifiedDate=date]}, {"FirstModifiedDate", each List.Min([ModifiedDate]), type date}}), #"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"ModifiedDate"}, {"Data.ModifiedDate"}), #"Renamed Columns" = Table.RenameColumns(#"Expanded Data",{{"Data.ModifiedDate", "ModifiedDate"}}) in #"Renamed Columns"
Best regards,
Anonymous
6 years agoNot applicable
Was I not clear?