2 Replies Latest reply: Dec 22, 2017 1:56 AM by Marcus Sommer RSS

    What am I doing wrong?

    Derek Emlet

      Hello All,

       

      I have tried different aggregates with no success. Anyone want to help get this simple equation to work.

       

      I have two calculated fields formatted at Date 'DD'. Actual Time and Estimated time. I am trying to calculate the error percentage in decimal format.

       

      Equation:

      =([Act_TimetoComplete]-[Est_TimetoComplete])/([Act_TimetoComplete])

       

      Example Data:

      =(12 - 10) / (12) = .1666667

       

      QlikSense is calculating this incorrectly. This example is showing .063011596531349.

       

       

      Thanks in advance

       

       

      UPDATE - after helpful replies.

       

      The calculation was working this whole time (I had a long day yesterday). I was comparing my results to the Act/Est fields as a Dimension "(12 - 10) / (12) = .1666", rather then a Measure (44.94 - 42.12) / (49.94) = .06301.

       

      Thanks.

        • Re: What am I doing wrong?
          Andy Weir

          What I would suggest is to troubleshoot your formula create a simple table and add three measures, your est and act fields plus your equation then your dimension data should be what you are grouping on.   this will give you visibility of where in your data you have issue.

          • Re: What am I doing wrong?
            Marcus Sommer

            If you want to calculate with the day-number you will need to grab this number and not formatting a date or even a timestamp to the visual day because the real value of it will be remain a date or a timestamp. This meant you will probably need something like this:

             

            = (day([Act_TimetoComplete])-day([Est_TimetoComplete])) / day([Act_TimetoComplete])

             

            - Marcus