Forum Discussion

joe100's avatar
joe100
Frequent Visitor
4 years ago
Solved

Counting Number of Elements in Array

Having two columns: 

NUMBERID
ABC0157530001612224-25-1,0001612224-25-2,0001612224-25-3,0001612224-25-4
ABC015761EBC257D 85C16327 599F8358  CC990AEF  64CD90C5
ABC01578756567ZXC; 687687687BV; 8787687CVX

 

I wish to add a new column where will be presented number of element from column "ID".

The delimiters can be "," , " " , ";".

 

What's the best way to do this?

 

  • Hi, joe100 

     

    You can create a custom column in pq.

    Like this:

    List.Count(Text.PositionOfAny([ID], {","," ",";"}, -1))

    If you need to add newlines, you can use ‘#lf’:

    Did I answer your question? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.

    Best Regards,
    Community Support Team _ Janey

5 Replies