0 Replies Latest reply: Apr 22, 2013 10:12 AM by Panos Loukos RSS

    Only display data for predetermined week range

      Hi all,

       

      I am looking at introducing i) a slider where I could manually select a week number e.g. “w06, 2013” and ii)four buttons each one of which selects a predetermined time period (please see below) so that when I click on Button 2, graphs would display data from “w46, 2012” to “w06, 2013” (week 6 of 2013 being the most recent week in the 13-week range).

       

      Button 1: " All Weeks"

      Button 2: "13 Weeks Max"

      Button 3: "26 Weeks Max",

      Button 4: "52 Weeks Max”

       

      I am new to QlikView and trying to do that with set analysis and although I have come across a few relevant articles in the Community and applied the suggestions, I fail to span back to previous year’s (2012) data. Could you suggest a way to do the above?

       

      Thank you very much, your help is very appreciated!

       

      Panos

       

       

       

      To help you:

      1. Within my data, the Week number is named based on the convention “YearWeek” so that it is always ascending. So the 48th week of 2012 is 201248, the 3rd week of 2013 is called 201303 and so on. As 201303 is not that user friendly, I have introduced variables “vWeekName=right(Week,2)” (so, 201303 becomes 03) and “vWeekYearName='w' & right(Week,2) & ', ' & left(Week,4) (so, 201303 becomes w03, 2013) and I use these interchangeably in the qvw (the first variable in the graphs and the second variable in the calendar/slider).
      2. I want the default time period to be “All Weeks” and include all weeks’ data up to the most recent one.
      3. Please note that the most recent one is usually not the current week, e.g.week 17 for today, 22 April 2013, as there is usually a delay of a few weeks in loading the data. The current week is defined by variable vCurrentWeek=MaxString(Week)