In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula to add numeric value to a column and change the output as per range

Kaish
8 - Asteroid

Hi All,

 

I need a basic solution for how to add to a numeric vale in a column which is conditional as in there are thousand of rows having numeric value as (0,1,2,3,23,3,53,0,4,6,10 etc) I want to add +1 to all the data except o, that is o remains 0 but other numbers except o gets added +1 i.e 1 becomes 2, 6 becomes 7, ex- 0=0, 1=2, 5=6, 0=0 .Kindly guide me how can I achieve this.

Then I have one more requirement where if the column has value 2 it should come under a new column in range which is 0-5, in case of 40 it should be >30, in case of 7 it should be 6-15, there are three criteria's in range column which has 0-5,6-15, 16-29 and >30 . To give an overview I am attaching an image to make you understand better. Kindly help me out to solve this. 

 

Ex.   Age |  Output                        2nd Query :  Age   |    Range output

          0    |      0                                                    1     |        0-5

          0    |      0                                                    4     |        0-5

          1    |      2                                                    5     |        0-5

          2    |      3                                                    34   |        >30

          4    |      5                                                    12   |        6-15

          6    |      7                                                     80  |        >30

          2    |      3                                                     9    |        6-15

2 REPLIES 2
jdminton
13 - Pulsar

This is probably the easiest way to do this.

Snag_7001f9b8.png

jdminton
13 - Pulsar

--Hey @jdminton , I am getting parsing error for the second sample where in we have to keep the data within the range, could you please help me out why I am getting the parsing error for the same formula.

 

Can you share some sample data? It may be that your data is not formatted as number. If that is the case, put quotes around the numbers in the formula or add ToNumber() around each [Age] field value in the formula.

Labels
Top Solution Authors