Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Search instead for
Did you mean:
Discussion board for questions about the Qlik Community, its features, sharing information, general discussions and even some fun. This is for both new and longtime community members. Everyone is welcome!
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)?