Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

Default Year in Qlikview

Hi,

I have a chart where we are showing Sales by Region. We have a filter on Year and Month.

We need to make it as default selection as Current Year and Current Month.

In Date table we have two flag called Current Year Flag and Current Month Flag. If Flag value is 1, then it shows Current Year and Current Month.

How can we implement this.

We cant use max Year or max Month, as Date table has date till 2036 year.

Please suggest.

Thanks,

Sarif

15 Replies
sergio0592
Specialist III
Specialist III

You can try with trigger :

Document Properties -> Triggers -> On Open ->Add action -> Select in field -> Current Year flag=1

                                                                                                                Current Month flag=1

mhmmd_srf
Creator II
Creator II
Author

okk...

but if user select any other Year and Month after opening will it change accordingly?

Please suggest.

Thanks,

Sarif

sergio0592
Specialist III
Specialist III

Yes, user can change values after opening. If you want restrict values to current year and current month without user selection has effect, use set analysis.

mhmmd_srf
Creator II
Creator II
Author

okk...,

But in Set Analysis if we use sum({<CurrentYearFlag= {1}>}Sales).

Then it will show for Current Year Sales. If we select any other Year, chart will show 0. Because it is kind of Hard coding, as we putting Flag =1.

How to handle this situation?

We have another Pivot Table, where we need to show MTD Sales and YTD Sales. With same functionality.

Please suggest.

Thanks,

Sarif 

mhmmd_srf
Creator II
Creator II
Author

It is not working sir...I am attaching my App. Please check.

sergio0592
Specialist III
Specialist III

So, try to put a dynamic flag. Create a variable V_flag_year with : GetfieldSelection(Current_Year_flag). Create a list selection with Current_Year_flag field.

Use the variable V_flag_year in your set analysis expression.

sergio0592
Specialist III
Specialist III

I'am not at home, i can't open your .qvw. If you have somme screenshots.

Anonymous
Not applicable

As Jean suggested, set the trigger in the document properties select in field , year =year(today()) and month = Month(Today()) on open. And after open if the user select different year or month, the filter reflects accordingly.

sureshsindhigi
Contributor III
Contributor III

Hi Mohammad,

After referred you requirement, good that you have already created current year flag use this flag create a text object, name as "Reset to Default" Button & apply the action as "Clear All" and second action would be select Current year Flag, as per my knowledge this is the best practice where we have to provide this kind of button whereas users select some different selection & if they want to come back with default selection for any time of navigation.

Attached QVW for your reference & applied only for the year you can add current month & hope this will be helpful your requirement.

Regards,

Suresh Sindhigi.