I need help to clean this 'customer name ' colomn that combine with many information such as
[C18-0000193]POLYTAMA PROPINDO,[C20-00002783]Riyan Sukmana
[C21-00004818]Kilang Pertamina Internasional,PT (cont-proc services) ,[C21-00004819]Rony Budiman
which is the length in left and right word is very varies.
What I need only POLYTAMA PROPINDO and Kilang Pertamina Internasional,PT (cont-proc services)
Since Metabase doesn't support SPLIT syntax, my hope only regexextract, unfortunately, the documentation is only a few.
Please help for the custom colomn using regexextract
It's just regular expression, so you can use something like https://regex101.com/ to help.
Something like this could work:
trim(regexextract([Customer Name], "\[[^\]]+\]\s*(.+)\s*,\["))
Thank you for your quick response
I have try your code and its work!! I'm very happy
But sorry to ask again unfortunately in the colomn were some records like this
[C22-00006009][C20-00001281]TEGUHARTA LESTARI, PT,[C20-00001311]SUHARDI NICOLAUS
which is your regexextract code can not remove the second [C20-00001281]
Please help to solve this problem.
Thank you very much
@taufik Your question has nothing to do with Metabase, but is about general regular expressions
trim(regexextract([Customer Name], "\[[^\]]+\]\s*([^\[\]]+)\s*,\["))
Thank you very much for your help. You are the best.
I learn much from your code