title: Crystal reports - Group total
body: <p>I have a report that I've written and I understand how to create running totals and such, but need help creating a custom evaluation formula. </p>
  
  <p>I have two levels of groups, first group is based upon a certain user, the next group is based upon transactions that user has been involved in. I have details hidden, and am only interested in the totals for a particular activity. This is working great, and totals are working properly but the problem is, each activity has a 'line number', which essentially can be the same as another activity (ie: two activities can have lines 1, 2, 3 contained within), so doing a distinctive total based upon a set of data isn't accurate because I only want it to be distinct based upon each individual recordset, and not globally.</p>
  
  <p>The example is below... if I do a count on each record for this dataset, it comes out to 18 because there are duplicate line numbers on each... but if I do distinct, it only comes to 9 because of duplicate line numbers across multiple actives.</p>
  
  <p>I guess what I need to know is how I can take the totals per detail group, and have them total up in my second footer properly. I assume it's going to take me compiling together a string including the activity number and line number, and then comparing them?</p>
  
  <p><img src="https://i.stack.imgur.com/5a9h7.png" alt="recordexample"></p>
  
  <p>Here is an example of the data contained within the total groupings:</p>
  
  <p><img src="https://i.stack.imgur.com/B1vEM.png" alt="dataexample"></p>