Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

YTD comparison minus one day

Our data warehouse is always one day behind. This makes true inYTD comparisons unequal unless I subtract.

For example, on 4/2. If I'm doing a comparison between the current year and the previous year, I'm comparing data up to 4/1 in the current year but 4/2 in the previous year.

I'm using an auto-calendar but I don't see a "DaysAgo" option. 

This is my current set analysis for the previous year's Sales measure. I need this to be inYTD, 1 year ago, but also one day before to make it equal. Does anyone have any recommendations?

Sum( { $< [INV_DATE.autoCalendar.InYTD]={1}, [INV_DATE.autoCalendar.YearsAgo]={1} > } [SALES] )



Labels (3)
1 Reply
Contributor III
Contributor III

I just thought of something: Could modifying my inYTD flag in the Autocalander be the solution?

If (DayNumberOfYear($1) <= DayNumberOfYear(Today()), 1, 0) AS [InYTD]
If (DayNumberOfYear($1) <= DayNumberOfYear(Today()-1), 1, 0) AS [InYTD]