QlikView loads either missing or additional zeros, compared to the values in the data source.
For example data like in the below script is loaded with incorrect leading zeros.
On the second row the leading zero is missing, and on the fourth row there is an unexpected additional leading zero.
The observed behavior is a part of fundamental QlikView functionality and data compression technique.
In short this means that QlikView interprets and associates loaded data by best effort. As part of QlikView optimization and compression technique the same reoccurring value in a field is stored on the first occurrence only, and the following occurrence reference to the first (stored) value. This means that two values with identical numerical representation can not be stored with two different textual presentations in the same field in QlikView.
Please keep in mind that all numerical values in QlikView act as dual values. This means that they have an underlying numerical value that is used for calculations, and a textual formatted value which is the value seen in charts or as calculations results.
In the example below four rows of data are loaded. In the field F1 there are four different value.
- The first value in F1 is interpreted by QlikView as a numerical 1
- The first value is stored as numerical value 1 with textual presentation 1
- The second value in F1 is interpreted by QlikView as a numerical 1
- There is already a numerical value 1 stored in the field F1, so QlikView associates the second occurrence to the first value. This means that the value 01 will be associated as a numerical 1 with presentation value 1.
- The third value in F1 is interpreted by QlikView as a numerical 2
- There is no other value stored in the field F1 as a numerical 2, hence this value is stored as numerical 2 with the textual presentation value 02.
- The fourth value in F1 is interpreted by QlikView as a numerical 2
- There is already a numerical value 2 stored in the field F1, so QlikView associates the second occurrence to the first value. This means that the value 2 will be associated as a numerical 2 with presentation value 02.
- The loaded data will visually not look like the data source.
Identical numerical values are associated to the same textual presentation value in QlikView. For this reason it is not possible to store the same numerical value with different textual presentation values.
One way to resolved is to format the values as text by using Text() during reload.
This will result in the visual values looking identical to the data source. NOTE:
Value formatted with Text() will not have underlying numerical values, hence calculations on these values is not possible.