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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
balasundaram
Creator II
Creator II

How to show current year data only

I have designed dashboard.in my reports i have current and previous data.But while open report i want current year data. if i selected previous year in list box i want to get previous data in same report. Please provide any expression like that..

10 Replies
sushil353
Master II
Master II

hi,

You can create a trigger on open of document.. Select in field> =Year(now())

HTH

Sushil

deepakqlikview_123
Specialist
Specialist

Hi U can save report after selection of current year.so that when user open the report in accesspopint he will get current years data.

Thanks,

ashfaq_haseeb
Champion III
Champion III

Like this

Current Year Sales

=Sum({<Year = {'$(=Max(Year))'}>} Sales)

or

=Sum({<Year = {"$(vCurrYr)"}>} Sales)

 

Previous Year Sales

=Sum({<Year = {'$(=Max(Year)-1)'}>} Sales)

or

=Sum({<Year = {"$(vPrevYr)"}>} Sales)

ASHFAQ

Not applicable

Please find the attached file may this will help you.

this is done by trigger    

vardhancse
Specialist III
Specialist III

we can select the current year in the list box and make the list box as always one selected value.

Then by default current selected year will be default in the dashboard.

And we can create trigger->on open document-clear all.

So that every time we open the dashboard, by default the year will be current.

balasundaram
Creator II
Creator II
Author

i coudnt get attached file

balasundaram
Creator II
Creator II
Author

=Sum({<Year = {'$(=Max(Year))'}>} Sales)


its working separate selections only like


while opening its showing current year data,in list box if i selected previous year its showing previous data..but issue is if i selected both previous and current year in list box..its showing only current year...not showing total two year data..



how to solve this issue??

ashfaq_haseeb
Champion III
Champion III

=Sum({$<Year = P(Year>} Sales)


Will gives you both year.

Make sure to close thread, if it answered


Regards

ASHFAQ

balasundaram
Creator II
Creator II
Author

not working