title: How to use MDX to calculate the difference between dates on seperate rows?
body: <p>I am quite new to MDX and I need to write a query that gives me the day difference between two dates. The problem is that the dates exist on two different rows in my data. For example:</p>
  
  <p>My Fact table:</p>
  
  <pre><code>SEAL | STARTDATE | PROCESS | FK_DATE_KEY  
  1    | 2012-10-22|    A    | 20121022
  1    | 2012-10-24|    B    | 20121024
  2    | 2012-10-22|    A    | 20121022
  2    | 2012-10-26|    B    | 20121026
  </code></pre>
  
  <p>What I need returned is :</p>
  
  <pre><code>SEAL | AGE_IN_DAYS
  1    |      2
  2    |      4
  </code></pre>
  
  <p>Please help.... I have a date dimension that relates to my FK_DATE_KEY</p>