## Tuesday, June 16, 2009

### Set analysis and chart dimension

Using set analysis syntax in a chart expression can be useful but remember that set analysis is based on the concept of selection -- it still must work within the dimension of the chart.
For example, if you have a document where HFcst and Lag are two fields, you might have a chart expression that looks like this:
Sum({\$<Lag={2}>} HFcst)
That expression is a sum of HFcst with the set analysis syntax working like a selection override specifying that within the Sum function it should use the selection of Lag=2. You couldn't use that expression in a chart where Lag was one of the dimensions and have it work the way you might expect because the expression still must respect the dimensions of the chart -- each row of the chart must match a particular dimension value. But, as long as Lag is not used as the chart dimension then the expression could be very useful (perhaps as a comparison to the current Lag selection).

#### 1 comment: n.allano said...

Hi,

I am new in QV and understood the concept you have described. However I do have one question:

Let's say, I create a calculated dimension with ValueList(v_dateselection,v_previousmonth)
v_dateselection contains: Feb 2011
v_previousmonth contains: Jan 2011

Now, on the expression tab, I would create such expression:

if(ValueList(v_dateselection,v_previousmonth)=v_dateselection,count({\$}SD),count({\$}SD))

I understood from the QV Help, that I need to "restate the valuelist function with the same parameters in the chart expression"
But I feel that it would be simpler (but I can't make it work) with such expression (as my variable OpenMonth is have the same format as my 2 variables):

count({\$}SD)

Have you experience such scenario?
Thanks in advance,