Answers.Body: <p>How about something like this. Group by case id and transform on activity date with <code>min</code>:</p>
  <p><a href="https://i.sstatic.net/H5anp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/H5anp.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-04T08:25:16.253Z
Answers.Text: Thanks Demerit. Was trying to get my head round field transformations on dates, and ot quite getting it.
Answers.UserDisplayName: Craig Almond
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-03T16:50:06.077Z
Answers.LastActivityDate: 2023-03-03T16:50:06.077Z
Answers.UserDisplayName: Demerit
Body: <p>I have a list of cases- created in searchkit. And I've added in activity cases with a status of &quot;scheduled&quot;.</p>
  <p>Mostly- but not always this returns one activity per case. But sometimes it shows more.</p>
  <p>Is there a way of filtering these activity results to show the scheduled activity with the earliest date?</p>
  
Tags: <searchkit>
Title: Searchkit: filter activity results in a query to show activity with earliest date
ThreadText: # Searchkit: filter activity results in a query to show activity with earliest date
  
  (Asked by: username_0 on 2023-03-03)
  
  I have a list of cases- created in searchkit. And I've added in activity cases with a status of "scheduled".
  
  Mostly- but not always this returns one activity per case. But sometimes it shows more.
  
  Is there a way of filtering these activity results to show the scheduled activity with the earliest date?
  
  **Tags:** searchkit
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-03-03. Score: 3 | Accepted answer
  
  How about something like this. Group by case id and transform on activity date with `min`:
  
  [![enter image description here](https://i.sstatic.net/H5anp.png)](https://i.sstatic.net/H5anp.png)
  
  > **Comments:**
  > **username_0**: Thanks username_1. Was trying to get my head round field transformations on dates, and ot quite getting it.  
  
  ---
  
  