title: Subtotal and total in Apex Wrapper class with object fields
body: <p><a href="https://i.stack.imgur.com/gspJc.png" rel="nofollow noreferrer">Link to table</a></p>
  
  <p>Hi All,</p>
  
  <p>I am trying mimic the behaviour of Report using Apex and Lightning component. I am able to get subtotal and grandtotal result using GROUP BY ROLLUP(). However I cannot query more that 3 field which are not aggregated. I have 8-9 other fields to show along with subtotal and grandtotal of 4 columns.</p>
  
  <p>I have created a map of records which I have to show on page and there is an aggregated query. Could anybody suggest how to get all these in a wrapper class?
  I cannot use Report Builder for this because I have to divide the subtotal with a fix value and show below the subtotal.</p>