title: Jasper iReport - how to call a subdataset with parameter using a variable expression?
body: <p>I need a variable expression that calls a sub dataset with a parameter attached.</p>
  
  <p>I have a dataset which is returning a list of grocery purchases made.  Something like: </p>
  
  <pre><code>Milk, NJ, $1.23
  
  Chicken, DE, $5.45
  
  Milk, NY, $1.44
  </code></pre>
  
  <p>I am able to get a sum of the prices using a summation variable on the purchase price.  However, I need a total that takes the state tax into account.  In the above example, let's say the NJ sales tax multiplier is 1.06 and NY sales tax is 1.08.  Instead of my milk sum being 2.76 (=1.44 + 1.23), I need it to be 2.859 (=1.23*1.06 + 1.44*1.08). </p>
  
  <p>I have a subdataset <code>SALES_TAX</code> that with the query:</p>
  
  <pre><code>SELECT tax_multiplier FROM mydb.sales_tax WHERE state=$P{STATE}
  </code></pre>
  
  <p>and I essentially need:</p>
  
  <pre><code>Sum($F{PURCHASE_PRICE} * $V{getTax($F{PURCHASE_STATE)})
  </code></pre>
  
  <p>How can I accomplish this?  What will my getTax variable need to look like to query the SALES_TAX sub dataset with the purchase state field from the main dataset?</p>