title: Spark : Find preceding value form the list
body: <p>i'm struggling to find the preceding item from a list based on a variable.
  Let say i have a list </p>
  
  <pre><code>date = ['20190501','20190502','20190503','20190507','20190508'] 
  </code></pre>
  
  <p>and i have another variable stored as:</p>
  
  <pre><code>start_date = ['20190507']
  </code></pre>
  
  <p>what i would like to find is the preceding value of the <code>start_date</code> and store it as <code>previous_date</code> which i'm calling further down in my code.</p>
  
  <p>So in this case, the previous_date would be <code>['20190503']</code>.</p>
  
  <p>In another case if my <code>start_date = ['20190503']</code> and the list is the same, the 
  previous_date would be <code>['20190502']</code>.</p>