2 Replies Latest reply: May 20, 2009 5:34 PM by manic

# Set analysis - divide with x, where x depends on current selection

Hi all. I've got a nice set analysis question :)

I have an actual vs planned table chart. Planned values are yearly values read from an excel file. Actual values are sums. Chart dimension is a drill-down group Year-Month. Depending on whether nothing is selected or year is selected, index (which is actual/planned) is calculated differently - if nothing is selected then it's ok cause actuals sums are yearly and are divided with planned yearly values. If year is selceted then sums are monthly and to get the correct index those sums should be divided with monthly planned values (which are yearly/12).

So by using set analysis i should be able to determine which period is user looking at (yearly or monthly) so the index could be calculated accordingly. The 1 mil \$ question is - how? :)

Thank you and cheers,

Marko

• ###### Set analysis - divide with x, where x depends on current selection

Marko,

this is not really a Set Analysis problem... You wan to have different expressions depending on the FIeld that's currently used as a dimension in you Drill-Down Group.

You can use function GetCurrentGroup() to determine what formula needs to be used. You expression wil look like the following:

if(GetCurrentGroup(myDrillDown) = 'Year', <formula1>, <formula2> )

Oleg

• ###### Set analysis - divide with x, where x depends on current selection

Hm, next code is always returning 'N/A',

=if(GetCurrentField('Year-Month')='PostingYear', sum([Planned Sick-Days]), 'N/A' ))