Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

qliksensefl
New Contributor

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

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

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])

qliksensefl
New Contributor

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

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

Community Browser