Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

AND OR precedence rule

fmvizcaino
17 - Castor
17 - Castor

Hi everyone,

 

I just realized the precedence rule for AND OR is totally wrong. Am I crazy??

 

Considering AND as a multiplier and OR as an adder (according to logic gates theory), the following should give me 4 rows as a result, without the need to add parenthesis.

 

fmvizcaino_0-1659028182409.png

 

Best,

Fernando Vizcaino

 

6 REPLIES 6
FilipR
11 - Bolide

In order not to go crazy with AND/OR conditions, always put them in parenthesis in a logical way. 😁

It's good practice for whatever language you're writing in. 

fmvizcaino
17 - Castor
17 - Castor

Hey @FilipR ,

 

I agree with you that it's a good practice, but that doesn't correct the issue.

 

It would be similar to having the following:

2+2x2 = 8

2+(2x2) = 6

 

As math principles are, logic gates principles should also be consistent here.

 

Best,

Fernando Vizcaino

IraWatt
17 - Castor
17 - Castor

🤣 I have never thought about it. But after checking I think your right @fmvizcaino ! 

 

Does the Formula Tool have a specific programming language or is it an Alteryx creation which is transpiled to a language?

IraWatt
17 - Castor
17 - Castor

@fmvizcaino C based but what ever converts it to C ignores precedence. Seems this has been hiding in plain sight 😅 great spot. 

atcodedog05
22 - Nova
22 - Nova

This is defeinetely an interesting use case @fmvizcaino 😀

Labels