2 Replies Latest reply: Aug 22, 2016 5:53 AM by Sunny Talwar RSS

    calculating  last 30, 60, 90 days from a date field in qliksense

    Gaurav Khare

      Hello Experts,

      I need to calculate 30, 60, 90, past year etc from a date field and then to provide the outcome in the form of filters. Kindly provide solution

       

      Thanks in advance

      Gaurav

        • Re: calculating  last 30, 60, 90 days from a date field in qliksense
          Gaurav Khare

          To be more precise the requirement is to take a filter having values like Prior Month, last 30 days, last 60 days, last year etc. when user selects for last 30 days from the filter than the chart should change accordingly

           

          Kindly help

            • Re: calculating  last 30, 60, 90 days from a date field in qliksense
              Sunny Talwar

              May be create flags in the script and use a link table:

               

              LinkTable:

              LOAD Date,

                        'Last 30 Days' as Flag

              Resident MasterCalendar

              Where Date >= Today() - 30;

               

              Concatenate (LinkTable)

              LOAD Date,

                        'Last 60 Days' as Flag

              Resident MasterCalendar

              Where Date >= Today() - 60;

               

              Concatenate (LinkTable)

              LOAD Date,

                        'Last 90 Days' as Flag

              Resident MasterCalendar

              Where Date >= Today() - 90;

               

              Concatenate (LinkTable)

              LOAD Date,

                        'Last 1 Year' as Flag

              Resident MasterCalendar

              Where Date >= AddYears(Today(), -1);

               

              And then you can use Flag as your filter to select Last 30 Days or Last 1 Year