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

Issue in LYTD and YTD expression

My below LYTD expression

num(sum({<Month,Year,YearMonth,date ={">=$(vLastYearStart) <=$(vLastYear)"}>}Sales) ,'##0.0')

It will give data will may-21  .Even  if I select jun-22

Similarly for YTD

 num(sum({<Month,Year,YearMonth,date ={">=$(vYearStart) <=$(vMaxDate)"}>}Sales) ,'##0.0')

It will give data will may-22  .Even  if I select jun-22

But if I put space before below bold it will give all month data ir-respective of selection

 num(sum({<Month,Year,YearMonth,date ={">=$(vYearStart) <= $(vMaxDate)"}>}Sales) ,'##0.0')

Labels (3)
3 Replies
BrunPierre
Master
Master

How about this.

YTD
Sum({$<[Date] = {'>=$(=YearStart(Today()))'}>} [Sales])

YTD Previous Year

Sum({$<[Date] = {'>=$(=Date(AddYears(YearStart(Today()),-1)))<$(=Date(AddYears(Today(),-1)))'}>} [Sales])

priyanka08
Contributor III
Contributor III
Author

This is also give same result.Not working at all.

BrunPierre
Master
Master

Could you perhaps clarify this?

" But if I put space before below bold it will give all month data ir-respective of selection ..."