title: is there way to automate the below example
body: <p>If i have a df like the one shown below:</p>
  <pre><code>d&lt;-structure(list(ReviewType= c(&quot;Review&quot;,&quot;Review&quot;,&quot;Review&quot;,&quot;Correction&quot;,&quot;Correction&quot;,&quot;Review&quot;,&quot;Review&quot;,&quot;Review&quot;,&quot;Review&quot;,&quot;Review&quot;,&quot;Correction&quot;,&quot;Correction&quot;,&quot;Deficiency&quot;,&quot;Correction&quot;,&quot;Correction&quot;, 
                                  &quot;Deficiency&quot;, &quot;Deficiency&quot;, &quot;Deficiency&quot;, &quot;Correction&quot;,&quot;Correction&quot;,&quot;Deficiency&quot;,&quot;Correction&quot;),
                    Submissiondate= c(&quot;2020-08-29 04:32:00&quot;,&quot;2020-08-28 04:31:00&quot;,&quot;2020-08-26 04:31:00&quot;,&quot;2020-08-25 04:31:00&quot;,&quot;2020-08-24 04:31:00&quot;,&quot;2020-08-23 04:31:00&quot;,&quot;2020-08-22 04:31:00&quot;,&quot;2020-08-21 04:31:00&quot;,&quot;2020-08-20 04:31:00&quot;,&quot;2020-08-19 04:31:00&quot;,
                                      &quot;2020-09-27 04:31:00&quot;,&quot;2020-09-27 03:52:59&quot;,&quot;2020-09-28 17:30:00&quot;,&quot;2020-09-29 14:01:00&quot;,
                                      &quot;2020-09-05 03:00:00&quot;,&quot;2020-09-05 03:51:00&quot;, &quot;2020-09-03 23:59:49&quot;,
                                      &quot;2020-09-02 00:03:54&quot;,&quot;2020-09-01 00:04:48&quot;,&quot;2020-10-01 04:31:00&quot;,&quot;2020-10-11 04:31:00&quot;,&quot;2020-10-21 04:31:00&quot;),
                    CaseNo= c(&quot;124&quot;,&quot;123&quot;,&quot;125&quot;,&quot;121&quot;,&quot;121&quot;,&quot;125&quot;,&quot;123&quot;,&quot;123&quot;,&quot;123&quot;,&quot;123&quot;,&quot;123&quot;,&quot;123&quot;,&quot;123&quot;,&quot;125&quot;,&quot;123&quot;,&quot;123&quot;,&quot;123&quot;,&quot;124&quot;,&quot;123&quot;,&quot;127&quot;,&quot;127&quot;,&quot;127&quot;)), class = &quot;data.frame&quot;, row.names = c(NA, -22L))
  
  d = mutate(d, Submissiondate = as_date(Submissiondate))
  
  </code></pre>
  <p>Usually, i would use the below code to get each case's latest detail by a specific date (in this case: 2020-08-30) and i would manually input a date to get the required results</p>
  <pre><code>Aug28&lt;-dailysnapshot%&gt;%filter(Submissiondate&lt;'2020-08-30')
  
  maxshot %&gt;% 
    group_by(CaseNo) %&gt;%
    filter(Submissiondate==max(Submissiondate))
  
  FinalCounting&lt;-maxshot%&gt;%
    filter(ReviewType == &quot;Correction&quot;)%&gt;%
    dplyr::summarise(`Correction Outstanding` = n_distinct(CaseNo))
  
  FinalCounting&lt;-maxshot%&gt;%
    filter(ReviewType  == &quot;Deficiency&quot;)%&gt;%
       dplyr::summarise(`Deficiency Outstanding` = n_distinct(CaseNo))
  
  </code></pre>
  <p>if instead of this, i have a list of list of dates such as 2020-08-30, 2020-09-06,2020-09-13, is there a data.table solution which i can use to count for each of those specific dates?</p>