Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here

Changing numbers to % format

Highlighted
8 - Asteroid

Hi 

 

I have a few columns with numeric data. Data type is Double.

 

My goal is to change the data format to %. 

 

I used the Multi-Field Formula to multiply data by 100.

 

How do I add "%" to those fields? 

 

Thanks

Highlighted
12 - Quasar

Hi @cwoo

 

To show the percentage sign you'll have to store your number as string. In that case you can change the data type in your multi field formula to string. Bundle your current formula in a tostring(....) and add a +'%'. 

 

Hope that works!

Kat

Highlighted
13 - Pulsar

Unfortunately, there isn't a way to add a  percentage sign AND keep them as a numeric field. If they don't need to be numeric, you can change the fields to a string and manually add the '%'.  You can do all of that with the same Multi-Field Formula tool:

image.png

Highlighted
7 - Meteor

If you want to be able to use the field for calculations in formulas you will need to divide the field by 100 to get it into a decimal form by using the formula field.

 

If you want to add the actual '%' you will need to convert the field to a string format and then use the formula field to add the % sign, but then you will be unable to use in it mathematical formulas.

 

-Robert

Highlighted
8 - Asteroid

Hi @danrh

 

So I did that but I am seeing an error message. Please see below. 

 

Do I have to change the original fields data type to something? It is currently Double. 

 

%.PNG

Highlighted
7 - Meteor

I would use the select tool that you have there to change the data type to a string and then just use the formula tool to set the field equal to itself  + ' %'.

I believe the error is occurring because it hasn't changed it to a string before you are adding the %

Highlighted
8 - Asteroid

I didn't change output type to String - thus the issue. 

 

Thanks!

 

Labels