Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Does anyone know what << does in QlikView expressions?

Hi,

Just showing some new developers how to write expressions and one of them asked what the code '<<' does.  It appears in the syntax suggestions when you type <, but I can't find reference to it in the help or online.

Anyone know what it is for, or is it just a glitch in the auto-complete library?

Steve

1 Solution

Accepted Solutions
MarcoWedel

found it:

Bit Operators

>> 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.

View solution in original post

10 Replies
sunny_talwar

Not really sure what it does, but found some really weird results while doing some very simple testing:

Capture.PNG

First and last is essentially the same if Statement giving different outputs. Not sure why

MarcoWedel

seems to be a bitshift operator

marcus_sommer

An important use is when a left-associative binary operator modifies its left argument (or produces a side effect) and then evaluates to that argument as an l-value. This allows a sequence of operators all affecting the original argument, allowing a fluent interface, similar to method cascading. A common example is the << operator in the C++ iostream library, which allows fluent output, as follows:

cout << "Hello" << " " << "world!" << endl; 

Source: Operator (computer programming) - Wikipedia, the free encyclopedia

- Marcus

MarcoWedel

found it:

Bit Operators

>> 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.
marcus_sommer

Yes, it's bit-shift and I have a use-case for this:

Dimensions:

Load dual(_Dimension, floor((1<<(rowno()-1))/2)) as _Dimension, 0 as Xyz Inline [

_Dimension

" "

Kanal

Region

Gebiet

%Filialnr

Kategorie Normal

Kategorie SPI

Netz,

Jahr,

Monat,

KW

];

- Marcus

sunny_talwar

Marco How would we use this in QlikView?

Thanks,

Sunny

swuehl
MVP
MVP

I don't think that's an unary operator. It needs two operands.

= 1 << 3

returns 8.

binary 00001 shifted 3 steps to the left is 01000

sunny_talwar

Make Sense. Thanks swuehl

Anonymous
Not applicable

Hi Steve,

From Help:

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.

>>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.

Regards

Neetha