Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Cleansing a Blended % Field

Jatrog19
5 - Atom

Hi Alteryx Community,

 

I've got a column that needs to be in % with a numeric meta tag so that I can calculate on it. So I used the cleanse tool to strip it of any symbols and then used a formula tool to divide it by 100. Problem solved, right? Well, I discovered that while most of the rows are structured as "90%", others are structured as "0.5". So my workflow turns the "0.5" into "05" and then divides that by 100, which gets to "0.05" not "0.5" as it should be.

 

Thoughts on how to create a workflow that accounts for both types of percentages within the same column?

 

Thanks again for your support,

Josh

1 REPLY 1
tim-regas
8 - Asteroid

Hi @Jatrog19,

If you are certain that the only two types coming in are % and decimal format. One option would be to use a single formula tool with an if statement. First check if it has a "%" then strip the %, convert to a number and divide by 100, otherwise treat it as a number. Below is a mockup.Converted number.png

Labels
Top Solution Authors