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: 
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 !