Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

loganayaki
New Contributor II

Value setting for one field based on another field filter

I have a scenario where a filter is defined on Year. I am displaying quarters in the pivot table. If no Year is selected I need to display specific quarters of data say 2017 Q1 and 2017 Q2 but if an year is selected I need to display the quarters linked to the year selected. For example if 2016 is selected I need to display 2016 Q1, 2016 Q2, 2016 Q3 and 2016 Q4. This is a Qlik sense question.

Any thoughts?

1 Solution

Accepted Solutions
mov
Esteemed Contributor III

Re: Value setting for one field based on another field filter

Something like this should work (depending on your filed names of course):

=aggr(if(GetSelectedCount(Year)=0,

only({<Year={2017}, Quarter={'Q1','Q2'}>} QuarterYear),

only(QuarterYear)),QuarterYear)

3 Replies
mov
Esteemed Contributor III

Re: Value setting for one field based on another field filter

Something like this should work (depending on your filed names of course):

=aggr(if(GetSelectedCount(Year)=0,

only({<Year={2017}, Quarter={'Q1','Q2'}>} QuarterYear),

only(QuarterYear)),QuarterYear)

loganayaki
New Contributor II

Re: Value setting for one field based on another field filter

I am trying the below and throws an error,

=aggr(if(GetSelectedCount(FY)=0, only({<FY={'2017'}>}FQ), only(FQ)),FQ)

Cant see where the issue with the syntax. Please help!

loganayaki
New Contributor II

Re: Value setting for one field based on another field filter

Thanks Michael! Works fine now!

Community Browser