Skip to main content
hic
Former Employee
Former Employee

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.

 

State matrix.png

 

“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

8 Comments
Not applicable

And these vectors (the state space) explain why QlikView is so fast ...

Very usefull and very well explained

Fabrice

0 Likes
3,707 Views
Not applicable

Never paid attention on selected excluded, the selected state is held.

Very enlightening.

0 Likes
3,707 Views
marthacano01
Partner - Creator
Partner - Creator

Thank you!

0 Likes
3,707 Views
thanstad
Creator
Creator

This is absolutely interesting to distribute to BI users as well.

/TH

0 Likes
3,707 Views
Anonymous
Not applicable

Really ,this has cleared my doubt regarding  state vectors.

Thanks a ton

0 Likes
3,707 Views
Anonymous
Not applicable

Hi Henric Cronström,

Really informative blog

But I stuck in  the following line :

"One state space per user and alternate state is created."

Does it mean one state space per user and one state space per alternate state?

What does 'alternate state' here signifies?

Please help me to understand this.

Thanks and Regards

0 Likes
3,707 Views
hic
Former Employee
Former Employee

"Alternate state" means that you can have several sets of selections. Normally you just have one.

Alternate state.png

And yes, it means one state space per user and one additional for each alternate state.

HIC

2,824 Views
Anonymous
Not applicable
0 Likes
2,824 Views