3 Replies Latest reply: Feb 12, 2018 4:37 AM by Manish Kachhia RSS

    Problem with Inyeatodate()

    Simone Trabattoni

      Hi community,

      I'm facing a problem with the inyeartodate() function.

       

      http://help.qlik.com/en-US/sense/1.0/Subsystems/WorkingWith/Content/Scripting/DateAndTimeFunctions/inyeartodate.htm

       

      I'm trying to calculate the boolean result that inyeartodate() gives, working on two years. This means that I have some data like this:

       

      Load

      number,

      date(date) as InlineDate

      Inline

      [number,date

      1,01/02/2018

      2,01/02/2017

      ]

      ;

       

      Using those formulae:

      =InYearToDate(InlineDate, now(0), 0) // for the current Year

      =InYearToDate(InlineDate, now(0), -1) // for the past Year

       

      Everything works fine.

       

      date1.PNG

      The problem is that as I try to do the same thing with some database data, the second formula does not work.

      date2.PNG

       

       

      The Date Field in the database is imported with the function date(), so it is tagged as date. The difference is that in the inline example the InlineDate is not tagged as ascii and text, and in the database example yes. Is it probably the problem?

       

      Also, it bemuse me the fact that in the second example, the ...0) formula works, but the ...-1) no.

       

      Do you have any idea to solve this?

      Thanks in advance.