Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
suryaa30
Contributor II

Why is true represented by '-1'and not '1' in some cases of Logical functions

Tags (1)
3 Replies
MVP
MVP

Re: Why is true represented by '-1'and not '1' in some cases of Logical functions

True() is always -1 in qlik. I don't see an instance where it returns 1 instead. Have you noticed such a case ?

suryaa30
Contributor II

Re: Why is true represented by '-1'and not '1' in some cases of Logical functions

Its been same, Just curious to understand why it is -1.

MVP
MVP

Re: Why is true represented by '-1'and not '1' in some cases of Logical functions

Read this:On Boolean Fields and Functions

All Boolean functions and operations, e.g. IsNull(), True() and comparisons such as Date=Today() return 0 for FALSE and -1 for TRUE. Why minus one? Because it is equivalent to setting all the bits in the byte to 1, which is how TRUE is represented in most software systems (as opposed to FALSE, where all bits are set to 0).