Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Akaidi
Contributor
Contributor

Comparaison des Mois et Mois Year-1

Bonjour, 

Je me permets de vous écrire suite à une difficulté que j’ai rencontré lors de la comparaison des  valeurs de Nbr logements sur la période YearTodate(Max(month)) par rapport à Nbr logements sur la même période (même nombre de mois ) sur  Year -1. 

 

Labels (2)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

YearToDate - Current Year

=sum({<Datefield={">=$(=Date(yearstart(Max(Datefield))))<=$(=Date(Max(Datefield)))"}>}SomeMeasure)

YearToDate - Previous Year

=sum({<Datefield={">=$(=Date(yearstart(Max(Datefield),-1)))<=$(=Date(Addyears(Max(Datefield),-1)))"}>}SomeMeasure)

 

MonthToDate - Current Year

=sum({<Datefield={">=$(=Date(monthstart(Max(Datefield))))<=$(=Date(Max(Datefield)))"}>}SomeMeasure)

MonthToDate - Previous Year

=sum({<Datefield={">=$(=Date(Addyears(monthstart(Max(Datefield)),-1)))<=$(=Date(Addyears(Max(Datefield),-1)))"}>}SomeMeasure)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

YearToDate - Current Year

=sum({<Datefield={">=$(=Date(yearstart(Max(Datefield))))<=$(=Date(Max(Datefield)))"}>}SomeMeasure)

YearToDate - Previous Year

=sum({<Datefield={">=$(=Date(yearstart(Max(Datefield),-1)))<=$(=Date(Addyears(Max(Datefield),-1)))"}>}SomeMeasure)

 

MonthToDate - Current Year

=sum({<Datefield={">=$(=Date(monthstart(Max(Datefield))))<=$(=Date(Max(Datefield)))"}>}SomeMeasure)

MonthToDate - Previous Year

=sum({<Datefield={">=$(=Date(Addyears(monthstart(Max(Datefield)),-1)))<=$(=Date(Addyears(Max(Datefield),-1)))"}>}SomeMeasure)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Akaidi
Contributor
Contributor
Author

Thank you Vinieme, it worked !