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: 
badamsrinivas
Contributor II
Contributor II

Development

how to see only 2 years of data out of 10 years in qlik dashboards?

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
MayilVahanan

Hi 

If you want to restrict the data in script part.

Create the calendar for 2 years. 

And in the fact table , you can use exists() function. 

Load * from factTable where exists(Date);

or

Load * from factTable where Year(Date)>=Year(Today())-2;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
MayilVahanan

Hi 

If you want to restrict the data in script part.

Create the calendar for 2 years. 

And in the fact table , you can use exists() function. 

Load * from factTable where exists(Date);

or

Load * from factTable where Year(Date)>=Year(Today())-2;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
badamsrinivas
Contributor II
Contributor II
Author

Tq somuch for prompt reply,

1 more Query, if i would like to restrict same 2years data at front end(dashboard) level , what expression or function do i need to use??

MayilVahanan

Hi

Try like below

=Sum({<Year={">=$(=Year(Today()-1))"}>}urexpression)

Chart or KPI will give past and current year info.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.