Forum Discussion

Jalolbek85's avatar
Jalolbek85
Regular Visitor
2 years ago
Solved

Count a set of consecutive digits

Hi All, I want to count a set of consecutive digits from a product field called ‘Products’[Code]. Counting how many times the current digit appears consecutively from the current position. For exa...
  • ThxAlot's avatar
    2 years ago
    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrGwsDA3NrYwVorViVYyNDAA00ZG5pYWFkZGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
        #"Added Column" = Table.AddColumn(Source, "cnt", each Text.Combine(List.Transform(List.Select(Table.Group(Table.FromList(Text.ToList([Column1])), "Column1", {"grp", Table.RowCount}, 0)[grp], each _>1), Text.From)))
    in
        #"Added Column"