Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
schmittyj585
Contributor II
Contributor II

Automatic Filter when opening app

Hi!

I use an app that references a planning month and forecast month. I would like to open the app each month and it automatically filter ForecastMonthYear to current + future months. 

schmittyj585_1-1695818985558.png

 

 

 

Labels (6)
1 Solution

Accepted Solutions
Gabbar
Specialist
Specialist

Because the format of your PlanningMonthYear is not suitable for max function , in others words max function is unable to identify (and hence work) what kind of format is that.
I hope you have Date in your table in which you can use then try this:-
add A filter Pane and add the Date Field as Dimension then in search panel of that Filter Pane use
=Date>=Date(Monthstart(Today()),'DD-MM-YYYY')
or
Create a New Dimension :-
=Right(Month_Year,2)&Date(Date#(left(Month_Year,3),'MMM'),'MM')     Here Month_Year is your PlanningMonthYear
now in search Panel of this Dimension Search 
=Right(Month_Year,2)&Date(Date#(left(Month_Year,3),'MMM'),'MM') >= Num#(Text(right(Date(Today(),'YYYY'),2)&Date(Today(),'MM')))
Result should be like this

Gabbar_0-1696411143641.png


If it is not working please tell, if you dont have acess to create new master Dimension , create this as a random dimension, it will still work. Remeber to store these as Bookmarks.

 

View solution in original post

17 Replies
Vilo
Employee
Employee

You can set a default bookmark and landing page when you open the app. Please see this page for details:

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Bookmarks/set-default-bo...

schmittyj585
Contributor II
Contributor II
Author

Thanks Vilo. I should have been more specific. I have my own sheet. I want it to open to current month and prior month no matter when I open this sheet and include this in my bookmark. For example...I want to use the below formulas together, but don't know the logic to make both work at the same time.

 

1.       =PlanningMonthYear=Max(total PlanningMonthYear) -------> Current month selection

2.      =PlanningMonthYear=addmonths(Max(total PlanningMonthYear),-1) -----------> Previous month selection

 

Vilo
Employee
Employee

For this, how about you try adding a sheet action that will select prior month and current month for you whenever you navigate to that sheet. In the sheet properties select 'Actions' then under action you want 'Select values matching search criteria', then select your month field, and for the value you can add:

='>='&num(month(today())-1)&'<='&num(month(today()))

Vilo_0-1695830723873.png

 

schmittyj585
Contributor II
Contributor II
Author

I do not want to remove all other months from possibility of selections. I only want to start the sheet with the current and last month by using the filter pane.

Vilo
Employee
Employee

It is not removing the possibility of selections. It is filtering on the months you determined when you navigate to the sheet, as that's what you are looking for:

Vilo_0-1695831234260.png

You can still select other months as you see fit:

Vilo_1-1695831310916.png

 

 

schmittyj585
Contributor II
Contributor II
Author

OK thank you, I understand. This is not working as each of my "PlanningMonthYear" selections are set up as 1/1/2023, 2/1/2023, 3/1/2023.....therefore it is only set up as the first day of each month and works on a fiscal calendar, not standard calendar, so Today() is not an option. 

So when we check today, the current fiscal month is 10/1/2023 through next fiscal month, prior month is 9/1/2023.

Gabbar
Specialist
Specialist

Create a Variable name 
vMaxMonth  in Its Description use the Definition and the Use this variable in Filterpane to search Values.
Example:-
1st method :-
variable name vMaxMonth
Definition  =Max(total PlanningMonthYear)
in Filterpane search Type:-
=Month=$(vMaxMonth)
(If a month Name Comes Press Enter, Dont Click on Month That comes Up)
If a month Name Doesnt Come, there is Some Change Required in variable, Either an "=" in Definition or Something else.
2nd :-
If you Also Want to select Last two months Create a variable to Select Start Date of the period,  and then Use That variable in Month Filter Only like =Date>=$(DateVariable).
After Setting the Filter Create the bookmark,
3rd:-
If for last two month this Doesnt work, Then in You Calendar in Script Create a new Field name BookMark1(Anything) and Define it as 1 for last two month and null or Zero for any other Month.
then in your month Filter Use:-
=BookMark1=1 / =BookMark1='1'/=BookMark1="1"(Anyone of these should work).
I used First method to create a bookmark and it looks like this:-

Gabbar_0-1695878573567.png

varibale values changes with reload(Every Day)

 

schmittyj585
Contributor II
Contributor II
Author

OK, so I don't have access to create variables and the variables I do have - these do not correlate to my "PlanningMonthYear" Dimension.

I'm just not understanding why the below formula is not populating the current and prior month in my filter pane.

=(‘>=’ & PlanningMonthYear=Max(total PlanningMonthYear) & ’<=’ & PlanningMonthYear=addmonths(Max(total PlanningMonthYear),-1)

schmittyj585_1-1696342643660.png

 

Gabbar
Specialist
Specialist

Because the format of your PlanningMonthYear is not suitable for max function , in others words max function is unable to identify (and hence work) what kind of format is that.
I hope you have Date in your table in which you can use then try this:-
add A filter Pane and add the Date Field as Dimension then in search panel of that Filter Pane use
=Date>=Date(Monthstart(Today()),'DD-MM-YYYY')
or
Create a New Dimension :-
=Right(Month_Year,2)&Date(Date#(left(Month_Year,3),'MMM'),'MM')     Here Month_Year is your PlanningMonthYear
now in search Panel of this Dimension Search 
=Right(Month_Year,2)&Date(Date#(left(Month_Year,3),'MMM'),'MM') >= Num#(Text(right(Date(Today(),'YYYY'),2)&Date(Today(),'MM')))
Result should be like this

Gabbar_0-1696411143641.png


If it is not working please tell, if you dont have acess to create new master Dimension , create this as a random dimension, it will still work. Remeber to store these as Bookmarks.