Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

andy
Contributor 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
Contributor III

Qlikview manipulates data when reading from DB

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

1 Reply
andy
Contributor III

Qlikview manipulates data when reading from DB

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