How are you retrieving the results? Iterating through them as an array should be one of the fastest way to go about it.
You can use the standard for-loop or one of the built in libraries in there, Lodash (in particular
_.each() ) to iterate through them and store the consolidations for each group/column. There should also be lots of articles about iterating through arrays in the web.
If you have a consolidated value in the TM1 server, then a DBR would also workout.
Let us know how it goes.