Not even close but thanks.
I also think you are on the right track with your other process. I assume you summed these at the client group level.
Note that my views above do not take that into account. They will exclude clients only base on codes and clients and are not look at the department at all. your process above is doing this if you summed at group 2. Not sure if you have clients that crossover departments. If so you need to decide how you want to address it. You can always adjust the views to include them, group and join as necessary depending on how you need to handle it.