Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
markabrom
Contributor
Contributor

Passing GetFieldSelections to a variable

I have a requirement where I need to pass a value from a filter into a dimension and then have the data sorted using an  >= operator.

The data is a Fiscal Year column and if a 2015 value is selected in a filter I need to see only Fiscal Years that are greater than or equal to 2015.

So if I hard code the value 2015 as below, I get the correct results.

=if (FISCAL_YEAR >= 2015, FISCAL_YEAR)

it correctly returns

Fiscal_year
2015
2016
2017
2018
2019
2020

If I create a variable called v_fy with a hardcoded value of 2018

and use

=if (FISCAL_YEAR >= $(V_FY), FISCAL_YEAR)

This also works correctly

Returns
2018
2019
2020

Now the issue is when I assign the v_fy variable with a value of

=GetFieldSelections(FISCAL_YEAR)

and use the same

=if (FISCAL_YEAR >= $(V_fy), FISCAL_YEAR)

I then goto the filter and choose 2015, the only row I will get is:

2015

Why can't I see the other values when I use the GetFieldSelections with a variable?

 

 

 

 

 

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

I am assuming the Date filter is not on Fiscal year.
This is happening because qlik filters all values with that year. You will need to use set analysis in your table.
e.g. Your filter is on orderyear
Sum( {<OrderYear=,FiscalYear{">=$(=V_fy)"}>} Sales)

View solution in original post

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

I am assuming the Date filter is not on Fiscal year.
This is happening because qlik filters all values with that year. You will need to use set analysis in your table.
e.g. Your filter is on orderyear
Sum( {<OrderYear=,FiscalYear{">=$(=V_fy)"}>} Sales)