Forum Discussion
NPC
3 years agoHelper I
Extract specific numbers from a group
Hello, Hope you can help with this. I have a table that looks like this: Transaction ID Extracts 1 021, 003, 022, 603, 415 2 002, 001, 408, 510 3 005, 004, 006, 510, 415, 408...
- 3 years ago
Hi NPC,
You can extract these specific numbers from a group by using list functions.
Create a custom column using this M Code:
Extract = List.Last(List.Select(Text.Split([Extracts],","), each _ <= "006"))This code will:
- Convert your group into a list.
- Filter out everything except {001..006}.
- Return the right most element from that list.
In case you don't have any number from 001 to 006 in your group, you'll get a null value.
Works for you? Mark this post as a solution if it does!