Re: CategoryFilter: Summarise data rather than filtering data

40 views
Skip to first unread message

asgallant

unread,
Nov 12, 2012, 3:11:53 PM11/12/12
to google-visua...@googlegroups.com
This is tricky to implement, as it requires some hackery to work.  Basically, if I understand the nature of what you want, you need to group the data after it is filtered, and draw the chart based on the grouped data.  Here's a hack that I wrote to tackle this, applied to your code: http://jsfiddle.net/asgallant/tCVGM/

On Monday, November 12, 2012 1:11:19 PM UTC-5, Tim Bowker wrote:
Hi,

I've been playing around with the dashboard capabilities and I am struggling with the correct way to do something I believe should be very simple...
In brief I would like the functionality of a CategoryFilter but rather than filtering the data I would like it to re-summarise the data.
For example, I have sales for two markets (A,B) across a 3 week period:

Market, Week, Sales
A, 1, 10
A, 2, 11
A, 3, 12
B, 1, 5
B, 2, 4
B, 3, 3

In the unfiltered state I want to get the sum of sales across both markets:
Week, Sales
1, 15
2, 15
3, 15

When I filter market A or B I want to get back to the individual series correctly.

How do I do this?
I've attached where I've got to - the problem being that in the unfiltered state I get 2 series plotted on the chart rather than the sum total.

Additional notes:
1. In the final version I will have more than one filtering column (e.g. Market, Country, State etc.).
2. In the final version I will be reading from a Google spreadsheet so if I need to use the data query functionality that will be fine.

Thanks in advance,
Tim

Reply all
Reply to author
Forward
0 new messages