title: How to get last four days sale count in particular month and first 27 day's sale count?
body: <p>How to get each device number sale count and filter who had done a sales more than the first 27 days count(01/Mar/2020 - 27/Mar/2020) &lt; last 4 days count(28/Mar/2020 - 31/Mar/2020).</p>
  
  <pre><code>Device_num      Date        sale_type
  2344            1/3/2020      BP
  2344            12/3/2020     BP
  2344            15/3/2020     BP
  2344            20/3/2020     BP
  2344            28/3/2020     BP
  3455            10/3/2020     Retailer
  3455            15/3/2020     Retailer
  3455            31/3/2020     Retailer 
  
  
  output table
  Device_num  sale_type   1st_27dayssale  Tot_sale last4dayscount
  2344          BP             4            5           1           
  3455          Retailer       2            3           1
  </code></pre>