title: QLikView calculated dimension with aggregation w.r.t. other dimension in pivot-table
body: <p>In a pivot table, I have one calculated dimension with complex expression:</p>
  
  <pre><code>pick(1+match(IF([Corporate Account]='OTHER','[Sales Account]', 
  '[Corporate Account]'),...,...,...),...,...,...,...)
  </code></pre>
  
  <p>In another dimension, I want to sum revenu with respect to this first dimension. More precisely, I want to have value for this new calculated dimension be 'A' or 'B' depending on the total revenue with respect to the first field.</p>
  
  <p>So far, I came up with</p>
  
  <pre><code>=AGGR( IF(Sum(Revenue)&gt;10,'A','B'),
  $(=pick(1+match(IF([Corporate Account]='OTHER','[Sales Account]', 
  '[Corporate Account]'),...,...,...),...,...,...,...)))
  </code></pre>
  
  <p>and this is not correct (for all rows, output is Null()).</p>
  
  <p>Would you have an idea of what is the right syntax ?</p>
  
  <p>Many thanks in advance</p>