3 Replies Latest reply: May 23, 2012 4:57 PM by anelsonel RSS

    Help Please..Correct syntax for using Today

      I am new to Qlikview and trying to understand the 'Today' syntax using an If statement. The goal is to find the number of days open from Today's date - ClaimNotifyDate. 

       

      if (ClaimStatus = F , StatusDate-ClaimNotifyDate ,$(=today() - ClaimNotifyDate)) as 'Days Open',

       

      I am receiving this error message: Error in expression:')'expected

       

      Thanks..

        • Re: Help Please..Correct syntax for using Today
          Oscar Ortiz

          I would create a variable for the Today() function in the laod script:

           

          LET vToday = Today();

           

          For the expression i believe you had your ClaimNotifyDate field in the same expression as today function.

           

          if (ClaimStatus = F , StatusDate-ClaimNotifyDate ,$(=today() - ClaimNotifyDate)) as 'Days Open'

           

          if (ClaimStatus = F , StatusDate-ClaimNotifyDate ,$(vToday)-ClaimNotifyDate) as 'Days Open'

           

           

          Something to worry about here is that you want to have your date fields recognized as date fields.  So you still may have issues returning proper data and that;s most likely due to the format of the date fields you have.

           

          Good luck

          Oscar