4 Replies Latest reply: Oct 16, 2015 11:30 AM by Jonathan Poole RSS

    Minus select months - qlik sense

    Joanna Seldon

      Hiya

       

      I have a expression as follows

       

      count({$< Delivery_Date-= {"$(='>=' & Date(MonthStart(Today())) & '<=' & Date(MonthEnd(Today())))"} >}Customer_ID)

       

      This calculation works great to minus current month (oct 2015) delivery date data.

       

      however

       

      I have a bar chart that shows dimension week beginning (Order_Week)

       

      How do I amend the calculation above so that if the week beginning is e.g September , it will minus any (October 2015) delivery date data + (September 2015) delivery date data

       

      please help

        • Re: Minus select months - qlik sense
          Jonathan Poole

          If the week begins in the prior month and you want that week bucket to include the days in that week from the prior month, try using the weekstart() function to take the monthstart date and push the date back to the first day of that day's week:

           

          count({$< Delivery_Date-= {"$(='>=' & Date(WeekStart(MonthStart(Today()))) & '<=' & Date(MonthEnd(Today())))"} >}Customer_ID)