Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
smithc2005
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
smithc2005
Contributor III
Contributor III
Author

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

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