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: 
Not applicable

Straight table data filtering

I am making a P&L table but I only need to show data for the past 3 yrs which means 3 rows of data.

Problem is that the database contains data for more years and for different dates, i.e. there are entries for each quarter.

I need to show the data for 31/12/YYYY for the last three years.

Is it possible to do this in straight table?

11 Replies
MayilVahanan

HI

For that, you can try like this

=If(Match(STATEMENT_DATE,YearEnd(STATEMENT_DATE)),STATEMENT_DATE) as dimension

or

If(STATEMENT_DATE = YearEnd(STATEMENT_DATE),STATEMENT_DATE) as dimension

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

Guys,

I'm not sure whether it helps to your application but the best practice is not to use if() in dimensions or expressions due to big impact to performance. The best practice is to use set analysis and in your case it's possible to create flag in calendar for each december 31th, also you can have such flags for periods you need to analyse (previous year, last 3 year, etc).

Believe me since I managed with performance degradation only after rewriting all if()'s with set analysis expressions in an application with 300 millions transactions.

Best regards,

Maxim