Discussion Board for collaboration related to QlikView App Development.
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
found it:
>> | 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. |
Not really sure what it does, but found some really weird results while doing some very simple testing:
First and last is essentially the same if Statement giving different outputs. Not sure why
seems to be a bitshift operator
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
found it:
>> | 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. |
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
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
Make Sense. Thanks swuehl
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