1 Reply Latest reply: Jan 18, 2016 5:11 AM by Stefan Wühl RSS

    filter for weekend and week start in qlikview scripting

    vir vir

      Hi,

       

      I have a requirement where i want to filter the data according to below condition:-

       

      (1) we want to show the data according to extract date like this week Tuesday (19/01/2016) than in our filter condition we have to pick the data from this week Friday to next week start Monday.

       

       

      how to design the filter kindly help.

       

       

      fields to pick :   Name,Address ,Extract Date , Filter date

       

      Extract Date : is Tuesday

      Filter date : Friday to Monday ( Next Week Start)

       

       

      Kindly suggest.

        • Re: filter for weekend and week start in qlikview scripting
          Stefan Wühl

          Maybe using something along these lines:

           

           

          Set DateFormat = 'DD/MM/YYYY';

           

          Let vExtractDate = num('19/01/2016');

           

          Let vFilterStart = floor(WeekEnd( vExtractDate)-2);

          Let vFilterEnd = floor(WeekEnd( vExtractDate)+1);

           

          LOAD

                 Name,

                 Address,

                [Extract Date],

                [Filter Date]

          FROM ....

          WHERE [Extract Date] = $(vExtractDate) AND [Filter Date] >= $(vFilterStart) AND [Filter Date] <= $(vFilterEnd);