Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Lucius_Artorius_Castus

Not able to use getFieldSelections() with filter pane

Hi, I am using filterpane in dashboard with this expression date({<[CREATED_DATE-Year-Month]={">2020-12"}>} [CREATED_DATE-Year-Month], 'MMM-YYYY'), I needed to convert CREATED_DATE-Year-Month field in "JAN-2001" format so I have used date function for that But after that I am not able to target this filter with CREATED_DATE-Year-Month using getFieldSelections().
let me know if there is any solution

Thanks,
Lucious Arotorius Castus.

Labels (2)
2 Solutions

Accepted Solutions
LRuCelver
Partner - Creator III
Partner - Creator III

It would be easiest if you would do the formatting in the load script.

If that is not an option, you can use Aggr to create your dimension:

=Aggr(If([CREATED_DATE-Year-Month] > MakeDate(2020,12,31), Date([CREATED_DATE-Year-Month], 'MMM-YYYY')), [CREATED_DATE-Year-Month])

Note however that selections in the filterpane will still be applied directly to the [CREATED_DATE-Year-Month] field with its original formatting.

View solution in original post

LRuCelver
Partner - Creator III
Partner - Creator III

By adding a simple set analysis you can select multiple values:

=Aggr(If({1} [CREATED_DATE-Year-Month] > MakeDate(2020,12,31), Date([CREATED_DATE-Year-Month], 'MMM-YYYY')), [CREATED_DATE-Year-Month])

I don't know why you are getting the error. It might be related to the version of QS you are using. Updating to a newer patch might fix the problem. 

View solution in original post

5 Replies
LRuCelver
Partner - Creator III
Partner - Creator III

It would be easiest if you would do the formatting in the load script.

If that is not an option, you can use Aggr to create your dimension:

=Aggr(If([CREATED_DATE-Year-Month] > MakeDate(2020,12,31), Date([CREATED_DATE-Year-Month], 'MMM-YYYY')), [CREATED_DATE-Year-Month])

Note however that selections in the filterpane will still be applied directly to the [CREATED_DATE-Year-Month] field with its original formatting.

Lucius_Artorius_Castus
Author

@LRuCelver Thank you so much, It worked.

Lucius_Artorius_Castus
Author

@LRuCelver But after applying this logic filter pane is not letting me select multiple date and throwing this
error if I try to select multiple

Lucius_Artorius_Castus_0-1709110257066.png

 

LRuCelver
Partner - Creator III
Partner - Creator III

By adding a simple set analysis you can select multiple values:

=Aggr(If({1} [CREATED_DATE-Year-Month] > MakeDate(2020,12,31), Date([CREATED_DATE-Year-Month], 'MMM-YYYY')), [CREATED_DATE-Year-Month])

I don't know why you are getting the error. It might be related to the version of QS you are using. Updating to a newer patch might fix the problem. 

Lucius_Artorius_Castus
Author

Thanks, worked.