title: SSRS how to get a running total of inventory amounts IN and OUT from START DATE to END DATE?
body: <p>i have a stored proc returning inventory amounts between a start and end date.</p>
  
  <p>the QTY field shows on-hand inventory adjustments by date, either IN or OUT.</p>
  
  <p>i have a "run balance" field that needs to show the total QTY each day. if the InOut field is 0, it's QTY in. if it's a 1, its QTY out. the values reflected in In and Out are coded that way.</p>
  
  <p>EXAMPLE. if i start on 4/1/14 with 5216. then 1061 of product is made on 4/1/14 i need the run balance to take 5216 and add 1061 on the next line. the next line should read 6277 instead of 1061. then if some is shipped, take 6277 and subtract, and so on. </p>
  
  <p>i tried the running value on QTY, but it just repeats the QTY. doesn't calculate anything.</p>
  
  <pre><code>=RunningValue(Fields!QTY.Value,Sum,"Details")
  </code></pre>
  
  <p>i tried to post an image of my report preview, but i don't have the reputation ;-)</p>
  
  <p>any help would be MUCH appreciated. </p>
  
  <p>EDIT: OK, i tried this code block:</p>
  
  <pre><code>= Switch(RunningValue(Iif(Fields!InOut.Value = 0, Fields!QTY.Value,0),Sum,"Details"), 
  RunningValue(Iif(Fields!InOut.Value = "1", Fields!RunBalance.Value -   Fields!QTY.Value,0),Sum,"Details"))
  </code></pre>
  
  <p>and i am getting a 0 on the sum fields, and #Error on the subtraction fields. but, i think this is more the direction i need to go (i hope)....but i am still not getting it.</p>