Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
JaviValtu
Partner - Contributor II
Partner - Contributor II

Comparing semester selected vs previous

Hi, I need to display data comparing similar periods against their previous period (Month, Quarter and Semester). The problem is that when user select the current period (unclosed period) we should compare it with the same number of days in the previous period. I applied this logic with Month an Quarter using MonthStart and QuarterStart functions, and it works:

InMonthToDate([Day], Today(), 0) * -1 AS [CurMTDFlag], //Current Month Flag

if ([Day]>=date(MonthStart(Today(), -1),'DD/MM/YYYY') and [Day]<=date(MonthStart(Today(), -1)+(Today()-MonthStart(Today(), 0)),'DD/MM/YYYY'),1,0) as [PrMTDFlag], //Prior Month Flag

InQuarterToDate([Day], Today(), 0) * -1 AS [CurQTDFlag], //Current Quarter Flag

if ([Day]>=date(QuarterStart(Today(), -1),'DD/MM/YYYY') and [Day]<=date(QuarterStart(Today(), -1)+(Today()-QuarterStart(Today(), 0)),'DD/MM/YYYY'),1,0) as [PrQTDFlag], // Prior Quarter Flag

if (InMonths(6,[Day], Today(),0), 1, 0) AS [CurHYTDFlag] //Current Semester Flag

Now, I have this problem:

- How can I apply the same logic for previous SEMESTER (Always considering Semester 1 as Jan-Jun and Semester 2 as Jul-Dec)?

 

Thanks a lot!

Labels (3)
2 Replies
samazian
Partner - Contributor
Partner - Contributor

I have the same problem!! In my case I need to be able to switch between Months (comparing the selected month with its previous), does anyone know any solution?

Thanks!

Sue_Macaluso
Community Manager
Community Manager

@JaviValtu Are you using QlikView or Sense? I would like to move this into the correct product forum. Thank you. 

Sue Macaluso