This is possible - you need to create 2 gauge charts and use set analysis in each one to restrict it to the year. Probably the easiest thing to do would be to create a new column called Year, based on your date, or your set analysis will get very complicated. you can't use Year(Date) as a dimension in set analysis so it would have to be specified as a range:
Alternately you could use an if statement, but this is very slow for lots of records and generally not used:
=sum(if Year(Date) = '2010', Sales)
In the layout tab in the chart properties, you can set the condition for the chart to appear by clicking on the option button "conditional" and entering a formula. In this case, you want something like getselectedcount(Name)= 1 or getselectedcount(Name) >0 which would show the gauge charts whenever any selection is made in Name.
Does this work for you?
The conditional appearance thing is perfect, thanks
As for the other issue, Im afraid this isnt working. The IF version also gives me zero. Im wondering if Im missing something basic. I cant upload a version as the data is sensitive
I added this as an expression:
Gauge charts have no dimension right? So Ive added this as an expression but the value is always zero. I also added
Year(Date) as SalesYear
in the script to give me a Year value but the SUM always ends up as zero. Puzzled.
That's true, gauge charts have no dimension. You can however add one if you are doing trellis charts. I don't think a calculated dimension would work as a filter tho.
I'm not sure why
Wouldn't work in your example. I've attached a test file that I work with, hope this helps you in some way....
forecast.qvw 160.0 K