6 Replies Latest reply: Jan 18, 2017 9:53 AM by Siddharth Sharma RSS

    Need to create a flag that will give me value = 1 when dateField is last month date

    Siddharth Sharma

      Hi Team,

       

      Request you to please help me create a flag in Qlikview Script that will show value =1 when Date is Last Month Date

       

      I have created a flag but now not working because of change in Year from 2016 to 2017

       

      if(Month(date(DateField))=month(today())-1,1,0) as isLastMonth...............This is not working

      Similarly

      For last previous 3 months I was using

      if(Month(date(DateField))>=month(today())-3,1,0) as isLast3Month..This is also not working

       

       

      Can anyone please help me create similar flag

       

      Example

       

      Say today date is 01/18/2017

       

         

      DateFieldIsLastMonthIsPrevious3Month
      1/18/201700
      12/19/201711
      11/21/201601
      10/24/201601
      9/25/201601

       

       

      Regards

      Siddharth