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 after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Compare Digits Explanation?

PhilipMannering
16 - Nebula
16 - Nebula

Can somebody explain how Compare Digits works?

PhilipMannering_0-1606301894548.png

The example above returns True. I would have thought that comparing 1.1 to one significant figure and 2 to one significant figure would give 1 == 2 (i.e. a False). What am I missing?

 

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @PhilipMannering 

 

I saw this post.

https://community.alteryx.com/t5/Alteryx-Server-Discussions/CompareDigits/td-p/375178

 

And i tried your same example. Yes you are right i was expecting False but got True.

 

Really strange 🤔

PhilipMannering
16 - Nebula
16 - Nebula

@atcodedog05 Ok, thanks for the link. Think I understand it now.

 

It doesn't round, but finds the difference after those significant figures. So CompareDigits(12345, 12444, 3) would be 12,300 and 12,400 (to 3 s.f.) which don't match, but because the difference is less than a hundred (the amount of the third significant figure), it gets returned as True. A more succinct way of describing it is "are the values within x significant figures of one another". Confusing, but kinda makes sense... :S

atcodedog05
22 - Nova
22 - Nova

@PhilipMannering 

 

Great explanation now i kind of understand. I thought it was kind of string compare.

But i kind of understand how and powerful this is 🙂😎

 

Thanks again for this great new exposure😀

 

I never knew this existed 😅 

Labels
Top Solution Authors