Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Not applicable
Author

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

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

Thanks for your help.