Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Replace decimal with value if it meets criteria.

prose3
5 - Atom

Hi all,

 

I have a dataset that, if the number is between 0.995 and 1, we want to keep the value at .99 so it does not round to 1 when pasted into an excel template.

 

On a very basic level my output looks like this:

 

DirectorCategoryScore 1Score 2
Director 1Cat 10.800.992
Director 2Cat 1N/A0.9959
Director 3Cat 10.9971

 

I want the '0.997' and the '0.9959' replaced with '0.990' so it does not round to 1 in excel.

 

I've tried a formula tool with the output column Score 1 and the formula: "if 0.995 <= [Score 1] < 1 then 0.990 else [Score 1] endif". Can't get it to work. Data type is double.

 

I've also attached a more thorough sample doc (the Score columns are what should change).

 

Any help would be appreciated.

2 REPLIES 2
JosephSerpis
17 - Castor
17 - Castor

Hi @prose3 you need the following syntax in your formula tool to work.

 

 

if 0.995 <= [Score 1] and [Score 1] < 1 then 0.990 else [Score 1] endif

 

Formula_02112023.JPG

 

prose3
5 - Atom

@JosephSerpis thanks so much!

Labels