Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator
Creator

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
Creator
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.