title: Knockout compute new values on filter
body: <p>I'm building a very number-heavy app and one feature of the app is to be able to filter between the three results at the end. These are: Drugs, Disease &amp; All (both).</p>
  
  <p>I'm pretty new to Knockout so not totally sure what the best-practise way to approach the following situation would be.</p>
  
  <p>I have the values filtering, my problem lies with computing the new values. <strong>The totals at the bottom have to reflect what data is currently visible in the table.</strong> Although these cell values (apart from totals) in the codepen below are static, they're actually dynamic in my app and they're a computed combination of a couple of values that are stored in sessionStorage in the app on previous pages. (This screen is a totals page).</p>
  
  <p>Example:</p>
  
  <p><code>self.total = ko.computed(function () { 
       return sessionStorage.getItem('1') * sessionStorage.getItem('2')
  });</code></p>
  
  <p>So to clarify; initially the computed totals at the bottom of the table are a total sum of numbers in the table cells that are multiplications of numbers from sessionStorage. The totals values then need to update every time the table is filtered to reflect the total of the visible data.</p>
  
  <p><a href="http://codepen.io/anon/pen/nlemE" rel="nofollow">http://codepen.io/anon/pen/nlemE</a></p>
  
  <p>I appreciate this may be complicated to get your head around and if I haven't explained it well enough, let me know and I'll clarify.</p>