Alteryx Designer Desktop Discussions

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

Why is Formula tool returning 0 multiply by -1 as -0 ?

girkarkamlesh
5 - Atom

Hello, 
I'm doing a simple calculation to change the sign of incoming value to the opposite sign. 

While doing so, my first mathematical approach was to simply multiply it by (-1).

What I have noticed is, while all the numbers are getting with opposite signs, 0 is also getting assigned with negative sign.

You may see 0 in output window but in detailed window it shows as -0.

More over, even when I tried to transpose the column it is showing as -0.

I tried the same thing with incoming null values to get converted to 0 first and then to apply formula, go the same result.

 

I'm using Version: 2022.1.1.30961.

 

Is this a known issue ? 

Output with formula.PNGOutput with Transpose 2.PNGOutput with Transpose.PNG

Sample data I used - 

ValueID
1A
10C
100B
200E
 D
0G
-300H

 

 

3 REPLIES 3
Qiu
20 - Arcturus
20 - Arcturus

@girkarkamlesh 
I am not the expert on computer science, but it appears to be related with "Signed Zero" topic.

https://en.wikipedia.org/wiki/Signed_zero

In short, it is as per design to have negative zero for Double data type.
When you do the transpose, since some of the data is String type such as "A", "B" and so on, so the negative zero is also forcely converted to String "-0".
0509-girkarkamlesh .png
If we only the value of numeric for transpose, it will remain showing as "0" without sign.

 

Deano478
12 - Quasar

@girkarkamlesh to convert them to normal 0 you can try the ABS(x) function in a formula

Swathi
8 - Asteroid

You might want to change the datatype accordingly. From the screenshots i can see that one is v_String and other is Double.

Labels