Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
We're facing a strange error while reading the data from databse.
We're trying to load the following fields is_current,is_original flags which are of bit data type(in database) to Qlikview. In Database the flags are either 0 or 1.
But when I load these values in to QlikView, 1 appears to be -1. Indeed very strange.
Can any one has experienced this kind of error. I'm about worried that my client will lose interest on QlikView if I notify him about this error.
Kindly advise me.
Thanks,
Surendra
The 1 value in your database means True and 0 means False. In Qlikview True is shown as value -1 and False as 0. It's really as simple as that. If you don't like it that way you could simply multiply the values with -1 when loading so every -1 becomes 1.
Probably the database driver delivers your flag data as BYTE with all bits set to 1, which will be read as -1 by QV.
If you want a 1 instead of -1, just multiply by -1 when reading in
LOAD
-1 * is_current AS is_current,
...;
SELECT ... FROM ...;
If you want to use the flag as boolean, -1 is interpreted as TRUE, so there is nothing to do.
![]()
If I want to get the desired value I can fabs function instead. But my question is why QlikView is showing 1 as -1.
I've changed the data type of corresponding field in database to int.
Yet I'm getting the same output.
Hi,
Please ask to QlikTech.
Regards,
it is due to differences in the way the boolean type is handled by ODBC and OLEDB driver.
ODBC treats the boolean as a bit type, which has possible values of 0 and 1 where OLEDB treat as different .
but it doesn't matter since -1 treated as true...
or els you can Fabs