Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator II
Creator II

How to display the data from last year to current year current month

Hi,

I do have a line chart and I'm using the below code in Dimensions to display the line chart from previous year to current year.

If(Year>= (Max(TOTAL Year)- 1) and Year<= Max(TOTAL Year), Year)

But for current year is is showing the data for December month as well but I want to restrict it till current month.

Labels (1)
3 Replies
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

You can write set analysis if you have Date.

i.e 

Dimension : Month Year/Year

Expression : Sum({<InvoiceDate = {">=$(=Addyears(Max(InvoiceDate),-1))<=$(=Max(InvoiceDate))"}>}Sales)

this will give you results from last year till date.

 

Thanks,

Ashutosh

vikasshana
Creator II
Creator II
Author

Hi @AshutoshBhumkar ,

Thanks for that but I've a filter pane so based on the selections in the filter pane my line chart will get displayed.

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

What selections are you making in the dashboard ?

If you select Year, max Date will be the maximum date for that year and value will be taken from previous year from that date.