Early Access: The content on this website is provided for informational purposes only in connection with pre-General Availability Qlik Products.
All content is subject to change and is provided without warranty.
Skip to main content

BitCountScript and chart function

BitCount() returns how many bits in the binary equivalent of a decimal number are set to 1. That is, the function returns the number of set bits in integer_number, where integer_number is interpreted as a signed 32-bit integer.

Syntax:  

BitCount(integer_number)

Return data type: integer

Examples and results:  

Examples and results
Examples Results
BitCount ( 3 ) 3 is binary 11, therefore this returns 2
BitCount ( -1 ) -1 is 64 ones in binary, therefore this returns 64

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!