Alteryx Designer Desktop Discussions

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

Bitwise Functions

derekbelyea
12 - Quasar

Alteryx offers a selection of Bitwise functions:

 

  • BinaryAnd
  • BinaryNot
  • BinaryOr
  • BinaryXOR
  • ShiftLeft
  • ShiftRight

 

I would be interested to learn about use cases where these functions can be usefully deployed,

5 REPLIES 5
BrandonB
Alteryx
Alteryx

Hi @derekbelyea 

 

They are functions that quite honestly I need to use more! Have you already taken a look at the help page that covers them? https://help.alteryx.com/current/designer/math-bitwise-functions 

 

This has an explanation of each function and an example of how it evaluates. 

derekbelyea
12 - Quasar

HI @BrandonB  

 

Yes I have reviewed the help pages but could not immediately imagine how they would help me in my work.  If someone can suggest some business use cases where these functions would provide functionality not otherwise available in Alteryx then I would appreciate the guidance.

apathetichell
18 - Pollux

Do you use the python bitwise operators? I imagine that much of the usage is for HUGE amounts of data where tiny computation differences can make a difference in workflow execution times...

danilang
19 - Altair
19 - Altair

Hi @derekbelyea 

 

The bitwise functions are there to help you deal with bitwise data.  Most organizations will never see bitwise data, but industrial process use bitwise data extensively.  As an example, if you have a process that is controlled with 8 switches, you can represent these values as 8 separate fields, or you can pack these values into a single byte, to maximize storage and bandwidth efficiency.  The first switch is represented by the state of smallest bit, 1 is on and 0 is off.  The state of the second switch is stored in second bit , etc.  All the possible combinations of the states of the eight switches are then represented in a single byte with values from 0 to 255.  When you're dealing with the data you use the bitwise functions to read or set the individual bits.  Use BinaryAnd to read the values and BinaryOr to set a value.  BinaryNot will flip a specific bit. 

 

There are other uses as well.  For instance to find all combinations of N items taken M at a time, generate all the values from 0 to N-1 and use the bitwise functions to find all the values that have exactly M bits equal to 1. The bit numbers of the set bits in each value will give you all the unique combinations. 

 

tl/dr:  Most people will never need to use them, but if you're dealing with bitwise data, they are invaluable

 

Dan

 

 

jrobiso2
8 - Asteroid

I could use an example using 32-character binary values (such as IP addresses and netmasks). I couldn't get them to work -  I just kept getting back the netmask when I did BinaryAnd(BinToInt([BinaryIPAddress]),BinToInt([BinaryNetMask]))

Labels