Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
bharat19s
Contributor II
Contributor II

Calculate CY-LM, CY-YTM & CY-MTD, but month cycle not based on calendar month

Hi

I want to calculate Last Month (CY-LM) Sales and Year to Last Month (CY -YTM) Sales and Month to date (CY-MTD) sales.

But the month cycle is 27th of the previous month to 26th of the running month. Its not as per the calendar month, So i can't use MonthStart and MonthEnd function of QlikView.


Can i create my own function like MonthStart and MonthEnd which will consider this cycle?


I tried following ways but it will not work,if i run report between 27th to 31st of the month properly.


CY LM :-

Start: =Date(monthstart(AddMonths(Today(),-2))+ day(27),'YYYY-MM-DD')

End: =Date(monthstart(AddMonths(Today(),-1))+ day(26),'YYYY-MM-DD')

CY YTM :-

Start: =Date(YearStart(Today(),0,4),'YYYY-MM-DD')

End: =Date(monthstart(AddMonths(Today(),-1))+ day(26),'YYYY-MM-DD')


CY MTD :-

Start: =Date(monthstart(AddMonths(Today(),-1))+ day(27),'YYYY-MM-DD')

End: =Date(Today(),'YYYY-MM-DD');

1 Solution

Accepted Solutions
1 Reply