anchor.diff:            <Cell><Data ss:Type="String">Replacement Cost</Data></Cell>
           </Row>
           <% total_book_val = total_repl_cost = total_count = 0 %>
  -        <% @data.assets.to_a.group_by(&:asset_subtype).each do |ast, assets| %>
  -          <% assets.group_by(&:organization).each do |org, assets_by_org| %>
  -            <Row>
  -              <Cell><Data ss:Type="String"><%= format_as_fiscal_year(@data.fy) %></Data></Cell>
  -              <Cell><Data ss:Type="String"><%= org %></Data></Cell>
  -              <Cell><Data ss:Type="String"><%=  ast.asset_type %></Data></Cell>
  -              <Cell><Data ss:Type="String"><%=  ast %></Data></Cell>
  -              <% subtype_count = assets_by_org.count %>
  -              <% total_count += subtype_count %>
  -              <Cell><Data ss:Type="Number"><%=  subtype_count %></Data></Cell>
  -              <% book_val_for_ast = assets_by_org.sum{ |a| a.book_value.to_i } %>
  -              <% total_book_val += book_val_for_ast %>
  -              <Cell><Data ss:Type="Number"><%= book_val_for_ast %></Data></Cell>
  -              <% repl_cost_for_ast = assets_by_org.sum{ |a| a.scheduled_replacement_cost.to_i } %>
  -              <% total_repl_cost += repl_cost_for_ast %>
  -              <Cell><Data ss:Type="Number"><%= repl_cost_for_ast %></Data></Cell>
  -            </Row>
  -          <% end %>
  +        <% assets = @data.assets.joins(:fta_asset_category, :fta_asset_class).joins('INNER JOIN fta_vehicle_types ON fta_vehicle_types.id = fta_type_id AND fta_type_type = "FtaVehicleType"').joins('INNER JOIN asset_subtypes ON asset_subtypes.id = transam_assets.asset_subtype_id').joins('INNER JOIN organizations ON organizations.id = transam_assets.organization_id') %>
  +        <% assets.group('organizations.short_name','fta_asset_categories.name','fta_asset_classes.name','fta_vehicle_types.name', 'asset_subtypes.name').count.each do |k,v| %>
  +          <Row>
  +            <Cell><Data ss:Type="String"><%= format_as_fiscal_year(@data.fy) %></Data></Cell>
  +            <Cell><Data ss:Type="String"><%= k[0] %></Data></Cell>
  +            <Cell><Data ss:Type="String"><%=  k[1] %></Data></Cell>
  +            <Cell><Data ss:Type="String"><%=  k[2] %></Data></Cell>
  +            <Cell><Data ss:Type="String"><%=  k[3] %></Data></Cell>
  +            <Cell><Data ss:Type="String"><%=  k[4] %></Data></Cell>
  +            <% total_count += v %>
  +            <Cell><Data ss:Type="Number"><%=  v %></Data></Cell>
  +            <% book_val_for_ast = assets.where(fta_vehicle_types: {name: k[3]}, asset_subtypes: {name: k[4]}).sum{ |a| a.book_value.to_i } %>
  +            <% total_book_val += book_val_for_ast %>
  +            <Cell><Data ss:Type="Number"><%= book_val_for_ast %></Data></Cell>
  +            <% repl_cost_for_ast = assets.where(fta_vehicle_types: {name: k[3]}, asset_subtypes: {name: k[4]}).sum{ |a| a.scheduled_replacement_cost.to_i } %>
  +            <% total_repl_cost += repl_cost_for_ast %>
  +            <Cell><Data ss:Type="Number"><%= repl_cost_for_ast %></Data></Cell>
  +          </Row>
           <% end %>
           <Row>
             <Cell><Data ss:Type="String"></Data></Cell>
  
positive.code:       <Row>
          <Cell><Data ss:Type="String">Fiscal Year</Data></Cell>
          <Cell><Data ss:Type="String">Agency</Data></Cell>
          <Cell><Data ss:Type="String">Asset Type</Data></Cell>
          <Cell><Data ss:Type="String">Asset Subtype</Data></Cell>
          <Cell><Data ss:Type="String">Asset Tag</Data></Cell>
          <Cell><Data ss:Type="String">Description</Data></Cell>
  
negative.code:         <Row>
            <Cell><Data ss:Type="String">Fiscal Year</Data></Cell>
            <Cell><Data ss:Type="String">Transit Agency</Data></Cell>
            <Cell><Data ss:Type="String">Category</Data></Cell>
            <Cell><Data ss:Type="String">Class</Data></Cell>
            <Cell><Data ss:Type="String">Type</Data></Cell>
            <Cell><Data ss:Type="String">Sub Type</Data></Cell>
            <Cell><Data ss:Type="String">Count</Data></Cell>
  