Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
thomas_skariah
Contributor III

Number of days in a month

Hi all,

My financial year is from Jan to Dec and month end's on every last  sunday of the month.

Can anyone suggests how to get the number of days for each month in such scenario.

Thanks in advance.

Regards,

Tomr

Tags (6)
1 Solution

Accepted Solutions
thomas_skariah
Contributor III

Re: Number of days in a month

Hi Kiran,

Thanks for your helpful reply.

I have made some slight changes in the code and also as mentioned the month end's on last Sunday instead of that I have changed it to last Saturday of the month. Find the attached sample application.

Regards,

Tom

4 Replies
Not applicable

Re: Number of days in a month

Tomr:

Does each month start with 1st or the day after last sunday of previous month?

Kiran.

thomas_skariah
Contributor III

Re: Number of days in a month

Hi Kiran,

Thanks for your reply.

Ok, for example Jan 2012 starts on 26th Dec-2011 to 29th Jan 2012 (that is last sunday of the month)

Feb 2012 starts on 30th Jan 2012 to 26th Feb 2012 and so on.

Regards,

Tom

Not applicable

Re: Number of days in a month

May be this would do:

WeekStart(MonthEnd(vDate))-WeekStart(MonthStart(vDate))

Replace vDatewith any date of a month you need no.of days for. I tried using today and got 28 and with 23-Jan-12 i got 35 as expected.

Kiran.

thomas_skariah
Contributor III

Re: Number of days in a month

Hi Kiran,

Thanks for your helpful reply.

I have made some slight changes in the code and also as mentioned the month end's on last Sunday instead of that I have changed it to last Saturday of the month. Find the attached sample application.

Regards,

Tom

Community Browser