3 Replies Latest reply: Dec 1, 2016 3:25 PM by Alluraiah Allu RSS

    Need to get weeks from Date field

    Prasant Tata

      Hi Mates,

       

      I am stuck with a issue in QLIKSENSE and your help is very much appreciated.

       

      I have date field which is like Jan 2015, Feb 2015.....Aug 2016.

       

      I need to extract weeks using this date, Is there any way to it?

       

      Secondly, I need to show prior 13 weeks data from the selected month.

       

      Thanks For Your Help,

      Prasant Tata

        • Re: Need to get weeks from Date field
          Sunny Talwar

          Since you don't have a day in your date which week do you want to see? 1st week of the month, last week of the month or something else?

            • Re: Need to get weeks from Date field
              Prasant Tata

              Hi,

               

              So this should be something like a drill down.

              By default it should display all available months in current year. If user select "Mar 2016", Chart should display starting from 1st week of January 2016 till last week of march 2016( Say 12 Weeks).

               

              That is what user is expecting.

               

              Hope it is clear

               

              Thanks,

              Prasant Tata

            • Re: Need to get weeks from Date field
              Alluraiah Allu

              1)try to get Weelfiled like this

               

              Week( Datefield) as Weekfield

               

               

              Sum({$<Weekfield={">=$(=(Max(Weekfield) -13))<=$(=(Max(Weekfield)))"}>}sales )

               

               

               

               

               

               

              your quote :

               

               

              I have date field which is like Jan 2015, Feb 2015.....Aug 2016.

              the above should be Month names ? not date fields ?

               

               

              you can try below for  last 13 weeks

               

                                    Sum({$<[MonthYear]={"$(=Date(Addweeks(Max(MonthYear), -13), 'MMM-YYYY'))"}>} sales)