Forum Discussion

RichOB's avatar
RichOB
Post Partisan
1 year ago
Solved

Isolating individual contains text

Hi, how can I split these issue results into individual counts from this table?: Issue Medical Concern Medical Concern; ASB - Violence ASB - Violence Medical Concern; Theft; Missi...
  • Elena_Kalina's avatar
    Elena_Kalina
    1 year ago

    The blank row issue typically occurs because:

    1. The source column contains empty values before splitting

    2. There are consecutive semicolons (;;) in the data, creating empty entries when splitting

    Solutions

    * Clean data before splitting:

    = Table.TransformColumns(#"PreviousStep", {{"Issue", each if _ = null then "" else _, type text}})

    * Remove extra delimiters:

    = Table.TransformColumns(#"PreviousStep", {{"Issue", each Text.Replace(_, ";;", ";"), type text}})

    *Split and filter out blanks:

    #"SplitColumn" = Table.SplitColumn(#"PreviousStep", "Issue", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"Issue"})
    #"Trimmed" = Table.TransformColumns(#"SplitColumn", {{"Issue", Text.Trim, type text}})
    #"Filtered" = Table.SelectRows(#"Trimmed", each [Issue] <> "" and [Issue] <> null)

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

    Thank you.