Alteryx Designer Desktop Discussions

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

User parameter does not equal its own value.

JPM
6 - Meteoroid

I am vexed. I have a numeric user parameter that I need to equal 2.25%. I need to filter values that equal to 2.25%. However, for some odd reason, my parameter that I explicitly enter as 0.0225 does not equal 0.0225. I cannot get any additional information as to what is going on and it is driving me nuts.

 

I have attached a minimal reproducible example. It is very minimal and it does not work! This seems so basic that I must be missing something obvious but I cannot figure out what it is.

 

JPM_0-1616791489245.png

JPM_1-1616791528262.png

 

 

6 REPLIES 6
Luke_C
17 - Castor

Hi @JPM 

 

This is super interesting. No clue why it's happening, but if you use 0.022500 in the formula (or update the constant) then it should work.

 

Luke_C_0-1616792487397.png

 

AngelosPachis
16 - Nebula

Hi @JPM,

 

The reason why this happens is because Alteryx (and generally computers) does not store values as you see them on your screen. For example, you might see 0.001 being displayed, by your computer might store that as 0.000999999999.

 

For example, [User.x] might appear to be equal to 0.0225, however look what happens if you apply a round function

 

AngelosPachis_0-1616792973300.png

 

Your [x_diff] is not 0 anymore, but something to the raised to the power of -18.

 

So by using the round function, I have forced the value [x] to be exactly equal to 0.0225, but since the x_diff value is positive, that means that 

 

[User.x] = 0.225 - 3.46944^E-18

 

So if you explicitly want your parameter to 0.225, think of using a round function (or do what @Luke_C  suggested above, it appears to be working)

JPM
6 - Meteoroid

I suspected something like that but could not prove it. Do you know why it is more efficient to store 0.0225 as something like 0.022500000001 than just 0.022500000000? I thought data type just allocated spaces. There must be a reason since from my (limited) perspective it seems to introduce unnecessary inaccuracy for no good gain.

JPM
6 - Meteoroid

If I add two trailing zeroes to the constant in the Workflow user parameter section it does not fix the problem but it does work if I add the zeroes to the `x_test` formula, e.g.

[User.x] == 0.022500

So what is the advantage of using numeric parameters if they need to be passed to round functions just to get a working filter? I feel like I must be missing some crucial part of the process (e.g. declaring parameters more explicitly in some way) because surely this has come up before.

patrick_digan
17 - Castor
17 - Castor

@JPM it's super confusing, I have an idea of alteryx providing a flag or cue to indicate when a number is displaying something other than it's true value https://community.alteryx.com/t5/Alteryx-Designer-Ideas/visual-indicator-actual-value-anytime-displa...

AkimasaKajitani
17 - Castor
17 - Castor

You put into the value to Text Input tool, after that you can use the 'correct' value.

 

AkimasaKajitani_0-1616895070189.png

 

AkimasaKajitani_1-1616895289494.png

 

It seems that if we put directly into expression, Designer may not interpret it as the value we intend.

 

Labels