title: group by clause in X++
body: <p>Another weird question, is it possible to specify an expression in a group by clause in X++? basically, how can I do the following:</p>
  
  <pre><code>while select InventDim **group by substr(InventDim.inventBatchId,1,3)**
  join InventDimId from InventTrans
  where InventTrans.inventDimId == Inventdim.inventDimId &amp;&amp; InventTrans.ItemId == _itemId
  {
  MyQty += inventTrans.Qty
  }
  </code></pre>
  
  <p>thanks for your help
  regards,
  Thomas</p>