Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlik Sense set analysis to calculate YTD for last year according to the year selection

I want to compare the number of Quote of the last year(From the year begin to the max QuoteDate in current year) to current year YTD, the current year can be choosed  in the filter panel.

For example, the max QuoteDate of current year is 10/10/2017,If I choose 2016 in the filter panel, I want to see the Quote numbers from 1/1/2015 to 10/10/2015

222.png

I use this :

Count( distinct [QuoteNo] )-Count({<[QuoteDate.autoCalendar.Year]={"$(=(year(([QuoteDate.autoCalendar.Year]))-1))"},[QuoteDate.autoCalendar.Year]=>} distinct [QuoteNo] )distinct [QuoteNo] )  but it not work ......

2 Replies
sunny_talwar

May be this

Count(DISTINCT {<QuoteDate = {"$(='>=' & Date(YearStart(Max(QuoteDate), -1), 'MM/DD/YYYY') & '<=' & Date(SetDateYear(Max({1} QuoteDate), QuoteYear - 1), 'MM/DD/YYYY'))"}>} [QuoteNo])

Anonymous
Not applicable
Author

Sorry for reply late,It shows 0,but I learned a function SetDateYear, thank you all the same