Hi all
I have problem in solving my project in the field of parsing
I'm having my input like this
PARLE COOKIES HIDE&SEEK ASTD 4*120g OP |
BRITANNIA 50-50 MASKA CHASKA 4*120g OP |
TANG POW CONC LEMON 500g*2 OP |
KURKURE NAMK ASSORTED 3*85g OP |
SANTOOR SOAP SNDL&ALMND MILK 4*125g |
I need to parse only quantity of the product
for example i need my output
PARLE COOKIES HIDE&SEEK ASTD | 4 |
BRITANNIA 50-50 MASKA CHASKA | 4 |
TANG POW CONC LEMON | 2 |
KURKURE NAMK ASSORTED | 3 |
SANTOOR SOAP SNDL&ALMND MILK | 4 |
please Assist me
Solved! Go to Solution.
Regex is the tool of choice here. I approached the problem as follows.
Firstly identify and replace the 'size' with the word size, using the regex replace function with the following code: \d+g
This converts something like: bob 40*800g DS to bob 40*size DS and dave 400g*40 FO to dave size*40 FO
I then use the regex tool in 'parse' mode with the function: (\d+)
This will keep our remaining digits and parse them into a new column, which can be titled 'quantity'
Finally I built out a convoluted method for bringing back all the detail before the qunatity*volume is given.
Example attached.
Ben
Thank you, Ben it works good.but for some records it takes first number of the line instead of taking quantity.
here
I attached my example
Arr sorry, I did not identify the instances where a string may contain other digits. Let me take another look.
Ben
Thanks ben that works.
Sorry to say this.
my Field not only having "g" (gram). It also consists of lot of units such as "ml"(milliliter);"L" (Litre); "PULL"; "G" (Grams).for this cases it gives NULL.
how to come over this? It is possible in Alteryx
Please assist me....