Skip to main content
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
Showing results for 
Search instead for 
Did you mean: 

YTD issue

Hi Team,

I am struggling to find the solution for below YTD scenario based on the Fiscal year.

My requirement is :

I have a global filter of calendar date

If user selects a date between  Jan 2019 to Dec 2019 the data should be accumulate from April 2019 to Dec 2019  

If user selects a date between  Jan 2019 to July 2020the data should be accumulate from April 2020 to July  2020.

The above scenarios is working fine for me  by applyling below expression but where I am getting issue is 

If I select April 2019 to Jan 31st  2020 In this case  the values is getting doubled.  I confused Where I am getting wrong.

can anyone help me is there anything I can change from below expression to get solution for my issue

if(Year=Year(max(CalendarDate)) and Year=Year(Min(CalendarDate)),
SUM({<CalendarDate={"<=$(=date(max(CalendarDate),'DD/MM/YYYY'))>=$(=date(min(CalendarDate),'DD/MM/YYYY'))"},Type={'product'}>} sales),
SUM({<CalendarDate={"<=$(=date(max(CalendarDate),'DD/MM/YYYY'))>=$(=Date(addmonths(yearstart(max(CalendarDate)),3),'DD/MM/YYYY'))"} , Type={'Sales'}>} sales))



Labels (2)
1 Reply
Former Employee
Former Employee

Here is potentially another way to go at things, see the following Design Blog post:

Here is one on Set Analysis as well:

Hopefully those may help you get things sorted out.


To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.