In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Pick up of specific characters from cell

SArielle
7 - Meteor

Hi All, 

 

I am trying to perform a condition where if the column contains % then i want to pick up the XX.X%  or if the column contains a specific phrase then pick up 4-5 characters before that phrase in that column and put it in a new column. 

Is there a way to get that done? Any ideas will be great!

 

Thanks in advance!!

 

13 REPLIES 13
ddiesel
13 - Pulsar
13 - Pulsar

Hi @SArielle!

 

Will something like this work?

 

Capture.JPG

 

If not, will you please send over some dummy data and the desired output?

 

Thanks,
Deb

Qiu
21 - Polaris
21 - Polaris

@SArielle 
Try RegEx if you like it. 😁

@ddiesel 
Thank you for the input data.

0616-SArielle.PNG0616-SArielle-1.PNG

SArielle
7 - Meteor

Let me try your suggestion out but let me also share some dummy data that is similar to what I have. 

 

This is the data

CustomerDesc 1Desc 2Comment 1Comment 2
ADiscount given is 10% Approval pendingLast purchase 30% discount given 
BApproval given by DirectorDiscount given is 25%First discount 
CQuoted 15% above base priceCustomer requested loyalty discountDiscount given is 5.5%Approval given by Director

 

and the desired output would be having an additional column that captures the discount

 

CustomerDiscount
A10%
B25%
C5.5%
grazitti_sapna
17 - Castor

@SArielle, give this a try.

grazitti_sapna_0-1655280030844.png

 

Thanks!

Sapna Gupta
SArielle
7 - Meteor

Thanks Sapna, just a quick question if my numerics is not a % instead it is a $ in front of the numeric or if it is a specific phrase after the numerics how can i amend the regex format to achieve the same results you have?

grazitti_sapna
17 - Castor

@SArielle , I used the below regex. As $ is represented as the end of the line in Alteryx so I skipped this character and used a formula tool to replace the $ with ""

 

(\d.+%|\$\d.+)

grazitti_sapna_0-1655281225011.png

grazitti_sapna_1-1655281299820.png

Attached is the updated workflow.

 

Thanks!

 

Sapna Gupta
ddiesel
13 - Pulsar
13 - Pulsar

Hi @SArielle!

 

Did @grazitti_sapna's solution work for you? If so, kindly select it as the solution. Marking a solution helps other users facing similar issues.

SArielle
7 - Meteor

Thank you everyone!!! Really appreciate all the support on this! 

@grazitti_sapna  your solution was really great, it helped me to parsed out a lot of the data but still some minor errors. 

 

I also have an additional question, might be quite basic but does all the output from Regex auto becomes string despite choosing in the output columns as a double? 

grazitti_sapna
17 - Castor

@SArielle, as you are parsing the data in form like 10%, 35% so this can only result in string data type in case you just parse the digits then you can select the double data type.

 

Thanks! 

Sapna Gupta
Labels
Top Solution Authors