1 Reply Latest reply: Dec 15, 2016 12:38 PM by Manish Kachhia RSS

    Expression Help

    Mark Ritter

      I am trying to replicate an existing report created by a SQL stored procedure.

       

      The field AvoidableDays is defined as INT in the stored procedure.  As a result the decimal values of the data are ignored when summing. 

      For example the raw data might calculate as  4  & 5.7 for Avoidable Days for 2 rows.

       

      The stored procedure is showing the sum of these as 9.  Qlik however is showing the sum as 10.

       

      Here is the expression I have in my script to calculate this.

       

      If (("LENGTH_OF_STAY"-"GMLOS")>0,("LENGTH_OF_STAY"-"GMLOS"),0) as AvoidableDays,

       

      My expression is the same as the stored procedure.  But Qlik is treating the raw data differently than SQL. 

       

      How can I modify the expression in Qlik to drop the decimals and do what the Stored Procedure is doing?

       

      I need to have my numbers in Qlik match what they are currently seeing.  Even if it is wrong.

       

      Hopefully this makes sense.