Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
andy
Partner - Creator III
Partner - Creator III

Qlikview manipulates data when reading from DB

Hi folks,

When we read data from an Oracle DB with an ODBC there is one field (the IDNR which is a VARCHAR2) in one row of the data that gets erroneous.

It has IDNR= 1022795 in the database but is given the value IDNR= 01022795 if another post with IDNR= 01022795 is included in the dataset.

Included is a testapplication with two qvd's generated in different ways that shows the erroneous behaviour.

The version is 9

What is happening here?

Attached is a qwv file and two qvd-files to show the "bug"

/Andy

1 Solution

Accepted Solutions
andy
Partner - Creator III
Partner - Creator III
Author

Ok,

Found out that this is a feature of Qlikview.

A workaround is to read the specific column surrounded by text() like.

Load

     text(IDNR) as IDNR,

....

Kind of annoying since the table contains 40 columns and is read in a background qvw where new databases and tables to be fetched are added on the fly with configuration files. I don't know how to handle this, right now it is read in a separate qvw.

Qliktech support says:

The first row read from the table sets the type of the fields. (The type defined in the DB does not matter at all).

If the first row in a varchar-column has only numbers the field will be encoded as a number field - that is way the leading 0 was dropped.

If it was possible I would like a flag that could be set to true to force Qlikview to use the same types as defined in the DB-table.

/Andreas

View solution in original post

1 Reply
andy
Partner - Creator III
Partner - Creator III
Author

Ok,

Found out that this is a feature of Qlikview.

A workaround is to read the specific column surrounded by text() like.

Load

     text(IDNR) as IDNR,

....

Kind of annoying since the table contains 40 columns and is read in a background qvw where new databases and tables to be fetched are added on the fly with configuration files. I don't know how to handle this, right now it is read in a separate qvw.

Qliktech support says:

The first row read from the table sets the type of the fields. (The type defined in the DB does not matter at all).

If the first row in a varchar-column has only numbers the field will be encoded as a number field - that is way the leading 0 was dropped.

If it was possible I would like a flag that could be set to true to force Qlikview to use the same types as defined in the DB-table.

/Andreas