9 Replies Latest reply: Oct 29, 2013 6:33 PM by Stefan Wühl RSS

    Missing values when using Evaluate() in load script

      I'm trying to solve an odd issue where using Evaluate() in my load script is working most of the time, but failing consistently some of the time. I'm using Evaluate() to calculate the result of a mathematical function stored in the database, presenting the final value to the user in a chart.


      In more detail, in this particular use case, there is a set of mathematical functions stored in a database that contain placeholders for data. I am loading this data from the SQL server, performing the proper replacements on the placeholders, and then reloading that data in QlikView using Evaluate() to get the final result of the formula. However, while this works in ~80% of all cases, it fails in large sections of results without any real rhyme or reason. However, it does fail consistently (the same values will be null after every reload), and it will be sections of null values, not randomly interspersed throughout the data set. Here is what I'm using in the load script:


      SELECT deliv.field_id AS 'Field ID'
        ,flow_date AS CalendarDate
        ,REPLACE(curve.field_curve, 'PLACEHOLDER', balance/1000000) AS 'Curve'
        field_deliverability deliv
        field_deliverability_curve_detail curve
        curve.field_id = deliv.field_id
        AND curve.direction = deliv.direction
        AND deliv.balance BETWEEN curve.start_balance AND curve.end_balance;
        ,Evaluate([Curve]) * 1000 AS 'Curve Result'
      DROP Table RawData;


      Originally I was thinking that it may have been an odd cross-join induced error, but when I remove everything else and just have a data island, I still see the same results. As an example, I will see results like the following:


      DateFormulaResultExpected Result


      Has anybody else experienced anything like this? Any tips on how to solve this?


      Updated the formulas I had copied and pasted.