title: Totalling up values across salesforce account hierarchies
body: <p>I'm struggling to find an approach to the following problem, can anyone suggest a high level approach.</p>
  
  <p>Using talend, I have an input set of values for a set of accounts (from CSV):</p>
  
  <pre><code>AccountId, ValueXYZ__c
  </code></pre>
  
  <p>I want to store ValueXYZ against the SFDC account, which is no problem, but then I want to totalise ValueXYZ up for all the accounts with the same parent to 
  Account.Parent.TotalValueXYZ</p>
  
  <p>I then want to "roll" this all the way up the accounts hierarchy:</p>
  
  <p>Imagine account hierarchy:</p>
  
  <pre><code>A
  -B
  --C
  --D
  -E
  --F
  --G
  </code></pre>
  
  <p>I want 3 values on A: </p>
  
  <pre><code>ValueXYZ = account A's ValueXYZ
  TotalValueXYZ = total of ValueXYZ values for all accounts under A in the hierarchy 
  TOTAL = formula field to add together the previous 2 values
  </code></pre>
  
  <p>I want 3 values on account B</p>
  
  <pre><code>ValueXYZ = account B's ValueXYZ
  TotalValueXYZ = total of ValueXYZ values for accounts C &amp; D
  TOTAL = formula field to add together the previous 2 values
  </code></pre>
  
  <p>I want 3 values on account C</p>
  
  <pre><code>ValueXYZ = account C's ValueXYZ
  TotalValueXYZ = 0
  TOTAL = formula field to add together the previous 2 values
  </code></pre>
  
  <p>I've tried several approaches, but can't get any of them to work!</p>