The color coding – Green, White, and Gray – is the hallmark of QlikView. These are the colors that convey information to the user about which field vales are selected, which are possible and which are not possible.
These are the states.
If you think about it for a while, you will realize that there are two different states for each field value: One is the input state; the selection that the user has made – whether the field value is selected or not; and the other is the output state: whether the field value is possible or not, given the logical inference of the selection.
Two statuses, each with two possibilities. This makes four combinations: Selected possible, Selected excluded, optional and excluded. Hence: There are not just three states – there are four.
“Selected excluded?” you may ask. “How can a value be selected and excluded at the same time?”
It’s simple. It can first be selected, and then excluded by a selection in another field. An example: Let’s say that you have a sales application and you select Jan, Feb and Mar to get the sales for the first quarter. Then you make a second selection – a product that incidentally was sold just in March. This second selection will then of course exclude Jan and Feb from the possible Month values. Jan and Feb will be selected excluded.
The field states are stored in vectors; binary arrays that have the same number of bits as the symbol tables excluding NULL values; the same number of bits as the number of distinct values of a field. There is in fact also a third field state vector that keeps track of alternative field values: the field values that would be possible, had there not been a selection in the same field.
The blue color is sometimes used in QlikView to show whether a field is locked or not. But note that this is not a state – it is a flag for the entire field, and has thus nothing to do with the individual field values.
Finally, there are state vectors for the binary data tables also - vectors that keep track of which records in the data that are possible and which are excluded.
All these vectors are referred to as the state space. The vectors are updated at every selection and used every time QlikView evaluates which symbols to show in an object and which record to include in the calculation. One state space per user and alternate state is created.
This way, the state space vectors keep track of which data is relevant right now – they “remember” the user selection.
HIC
PS. All of the above is of course true for both QlikView and Qlik Sense. Both use the same engine.
If you want to read more about QlikView internals, see
Symbol Tables and Bit-Stuffed Pointers
Logical Inference and Aggregations
The Calculation Engine