Tuesday, 17 September 2013

what's the best associatice container for grouping data

what's the best associatice container for grouping data

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 (data, 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. Thanks

No comments:

Post a Comment