0 Replies Latest reply: Apr 21, 2017 11:19 AM by Danny Mortelmans RSS

    Rounding error when exporting in a script

    Danny Mortelmans

      Hi,

       

      I am facing the following issue; During the loading script I execute a certain set of aggregation functions on the data before storing the result in a csv. An example would be to take the sqrt() from a volume column and then export the result to CSV with the store functionality.

       

      When I perform a sqrt() on a column with cost data and export then to csv, there is no issue.

      However, if I perform a sqrt() on a column that has numbers coming from a previous calculation step where the count function was used (i.e., the number is 3 as it counted 3 times whatever we need), the result of the sqrt() gets rounded and I lose the decimals. So the sqrt(3) would be equal to 2 instead of 1.732... It doesn't matter whether the result is stored in QVD or CSV, the problem remains.

       

      However, if I look at the data table in QlikView itself after the script is done running, the number would not be rounded but would have the decimals. So the rounding seems to happen only during export.

       

      I am using QlikView 11.2 SR12 and cannot go to QV 12 for specific reasons.

       

      I also tried the User Settings -> Export -> Export Format to No Formatting but that obviously didn't help as I am not exporting a chart through the dashboard but am exporting with a store into during a script run.

       

      Anybody any solution?

       

      Many thanks in advance