Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Bitwise Operators in Scripts?

This may be very basic, but I can't seem to find bitwise operators in Scripts.

My input includes an integer that is a collection of set bits. I wish to do bitwise operations on this integer to pick out specific bits that are set.

How can I do this?

1 Solution

Accepted Solutions
MVP
MVP

Re: Bitwise Operators in Scripts?

Hi,

This is what help says:

"

Bit Operators

All bit operators convert the operands to signed integers (32 bit) and return the result in the same way. All operations are performed bit by bit.

bitnot Bit inverse. Unary operator. The operation returns the logical inverse of the operand performed bit by bit.
bitand Bit and. The operation returns the logical AND of the operands performed bit by bit.
bitor Bit or. The operation returns the logical OR of the operands performed bit by bit.
bitxor Bit exclusive or. The operation returns the logical exclusive or of the operands performed bit by bit.
>> Bit right shift. Unary operator. The operation returns the operand shifted one step to the right.
<< Bit left shift. Unary operator. The operation returns the operand shifted one step to the left.

"

Does this help?

Regards,  tresesco

4 Replies
MVP
MVP

Re: Bitwise Operators in Scripts?

Hi,

This is what help says:

"

Bit Operators

All bit operators convert the operands to signed integers (32 bit) and return the result in the same way. All operations are performed bit by bit.

bitnot Bit inverse. Unary operator. The operation returns the logical inverse of the operand performed bit by bit.
bitand Bit and. The operation returns the logical AND of the operands performed bit by bit.
bitor Bit or. The operation returns the logical OR of the operands performed bit by bit.
bitxor Bit exclusive or. The operation returns the logical exclusive or of the operands performed bit by bit.
>> Bit right shift. Unary operator. The operation returns the operand shifted one step to the right.
<< Bit left shift. Unary operator. The operation returns the operand shifted one step to the left.

"

Does this help?

Regards,  tresesco

upendrarajeshir
New Contributor II

Re: Bitwise Operators in Scripts?

Hi Tresesco,

Can you give any example, this would really help me...

Thank & Regards,

Upendra

MVP
MVP

Re: Bitwise Operators in Scripts?

Please check

http://en.wikipedia.org/wiki/Bitwise_operation

So one simple example in a textbox:

= 10 bitand 3

results in 2

upendrarajeshir
New Contributor II

Re: Bitwise Operators in Scripts?

Hey swuehl,

Thanks for the reply, it helps me a lot.

Thanks & Regards

Community Browser