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

Comparaison between Year N / N-1 for a given day

Hi there ! The title isn't really clear, my bad !

I've got a problem : the point is to compare two years. So to do it, I want to create two tab charts, the first one is the situation for the last year. The second one, for the current year.

But the problem is that I want to compare at a given day, I'll show you by an exemple :

IDSum between 01/01/2013 - 28/04/2013
110 000 €
IDSum between 01/01/2014 - 28/04/2014
115 000€

I don't know how to do to sum(Total) for this period : how to sum from the beginning to a given day ? And in an other chart, for the last year ?

I've got the variables Year, Month, Day.

Thanks a lot !

2 Replies
its_anandrjs

Write like

For First Chart current year

Dimension:- ID

Current Expression:- =SUM({$<DateField = {'>=$(=YearStart(Today()))<=$(=MonthEnd(Today()))'}>}Sales)

For Second Chart previous year

Dimension:- ID

Expression:- =SUM({$<DateField = {'>=$(=AddMonths( YearStart (Today()),-12))<=$(=AddMonths( MonthEnd (Today()),-12))'}>}Sales)

MK_QSL
MVP
MVP

What do you mean by a GIVEN DAY?

Is it a Date Field or until Today()