title: OBIEE Logical Expression - Sum by attribute
body: <p>I am trying create a calculated column in the logical table source expression builder.</p>
  
  <p>In my case, an order is made up of line items, and each line has a quantity.</p>
  
  <p>I want to add a new attribute based on the total quantity of all line items on the order.</p>
  
  <p>What I want to do is something like:</p>
  
  <pre><code>SUM(quantity) BY ORDER_ID
  </code></pre>
  
  <p>But that syntax doesn't work.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>CASE WHEN SUM("FINQ".""."XXDW"."xxdw_f_orders_items"."quantity") &gt;= 100 THEN '&gt;=100' ELSE '&lt;100' END
  </code></pre>