Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Boolean Identifiers

In a current table there is a field called [ReferencesQuestion] which is an integer field and can contain binary sequential values between 1 and 4096, there are other data associated with it.  I have another table with a set of categories (A-P) which defines which questions are relevant to which categories but it does this through binary comparison also using integers.  (e.g.  Questions 1 and 4 are relevant to Category A, Questions 1,4 and 32 are relevant to Category B). QC.jpg

In SQL I can write a boolean query which Selects records if  [ReferencesQuestion] & [CategoryInteger] = [ReferencesQuestion].  How do I do this in Qlikview?

Example Tables...

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm not quite following the mapping you gave in your example. But QV does have a number of bit operators as well as a bitcount() function. See "Bit Operators" in the Help.

"bitand" is the equivalent operator to SQL &. So something like:

[ReferencesQuestion]  bitand  [CategoryInteger]


-Rob

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm not quite following the mapping you gave in your example. But QV does have a number of bit operators as well as a bitcount() function. See "Bit Operators" in the Help.

"bitand" is the equivalent operator to SQL &. So something like:

[ReferencesQuestion]  bitand  [CategoryInteger]


-Rob

Not applicable
Author

Hi Rob,

Thanks!  bitand is exactly what I was looking for, I've implemented it in the code and it's perfect.  I only get the list of questions relevant to a Category.

[ReferencesQuestion] bitand [CategoryInteger] = [CategoryInteger]

KP

IAMDV
Master II
Master II

Hi Kevin,

Please can you close this thread and mark Rob's post as correct answer. It will help other community users.

Thanks,

DV

www.QlikShare.com