Reputation: 1197
I'm trying to store rows of data with parameters date, group1, group2, group3, analytics1, analytics2, analytic 3 into some sort of associative container. I will need to aggregate the analytics in 3 ways:
based on date (think of it like a group by in SQL)
based on group1, group2, group3
based on date, group1, group2, group3
There will be some simple math done after the data has been grouped. What would be the best data structure for something like this. I was thinking of doing a multimap(vector, vector) with key and value both being vectors, key is a vector of the form (date, group1, group2, group3) and value is a vector of the form (analytics1, analytics2, analytics3). This way it will be at its most granular level but I'm pretty sure I'll still end up having to do 3 separate iteratings to take care of the groupings. Is there a faster alternative approach?
Upvotes: 0
Views: 111
Reputation:
You may want 'Boost Multi-index Containers Library' (http://www.boost.org/doc/libs/1_54_0/libs/multi_index/doc/index.html)
Upvotes: 1