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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rcb07
Contributor II
Contributor II

How to select the current fiscal year dynamically in the filter by default every time the dashboard loads

Hello,

I am new to Qlik sense, I have a filter in my dashboard named "FiscalYear" having values like FY23, FY24, etc. I want to select the latest FiscalYear value by default every time the dashboard loads. The user can also select multiple values from the filter and deselect the default selected value.

I was trying to implement this by using the bookmark method but I am unable to find the exact field expression to be applied in the filter so that it will always select the latest FiscalYear.

I have tried Max, Maxstring but non of them worked. Can someone please help me with this?

rcb07_0-1709112605115.png

If there are any alternative or more efficient ways to do this then please suggest.

Qlik Sense Desktop Qlik Sense Business 

 

Labels (4)
7 Replies
henrikalmen
Specialist II
Specialist II

Try this as your search expression (including the surrounding curly brackets):

{<"=FiscalYear"={"=FiscalYear="$(=maxstring({1}FiscalYear))"}>}

rcb07
Contributor II
Contributor II
Author

Hi @henrikalmen,

Thank you for your reply, I tried the expression but not getting any match in the search field.

rcb07_0-1709122223962.png

Do I need to add anything else here?

 

henrikalmen
Specialist II
Specialist II

No, you're right. When experimenting I can't get it to work with a text field. Perhaps you could make it a numeric field instead, using dual(). I have done this with numeric fields, so I know it should work then.

rcb07
Contributor II
Contributor II
Author

Actually it's a requirement that I need to get the latest FY value from this string data type only, not allowed to change it to numeric data type.

henrikalmen
Specialist II
Specialist II

I'm trying e.g.searching $(=maxstring([FiscalYear])) in a listbox but it
also gives no result. But if I put the same expression in a text chart,
I get the maxstring I'm looking for. Perhaps it's got something to do
with that maxstring() is an aggregation function? I hope somebody else
is able to explain what's going on here, I'm curious.
henrikalmen
Specialist II
Specialist II

Can you add a flag in your data model so that you have a new field next to FiscalYear, named e.g. latestFiscalYear and set it to 1 for the latest FiscalYear? If so you could do this search in the FiscalYear field:

=[latestFiscalYear]=1

johngouws
Partner - Specialist
Partner - Specialist

I am using a trigger when opening a tab or when opening the model, in QlikView to achieve this. My trigger is for a field name 'Year' and the expression is: "=if( month(Today()) < $(FirstMonthOfYear), year(Today()), year(Today())+1)". The FirstMonthOfYear is the month the fiscal year starts, in my case 7. 

It works for me, I hope it does for you.