Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

I have Year and Month how to Get No of Days in Month

Hi Dears,

I have a table of Years and Months like This

Month,     Year

Dec,          2015

Nov,          2015 

Jan,           2016

Oct,          2015

I want to know in an accurate way how many days are there in each month like this

Month,     Year,          Days

Dec,          2015          31 

Nov,          2015          30

Jan,           2016          31

Oct,          2015          31

I Tried

LOAD *, (MonthEnd(Month)-MonthStart(Month)) as Days

but this resulted in 31 Days in all months although it is known that Nov is only 30 Days.

Thanks in advance

stalwar1

sokkorn_cheav

swr

gwassenaar

jontydkpi

1 Solution

Accepted Solutions
Highlighted

May be like this:

LOAD Month,

          Year,

          Day(MonthEnd(MakeDate(Year, Month(Date#(Month, 'MMM')), 1))) as Days

FROM...

Update: Sample attached

Capture.PNG

View solution in original post

5 Replies
Highlighted

May be like this:

LOAD Month,

          Year,

          Day(MonthEnd(MakeDate(Year, Month(Date#(Month, 'MMM')), 1))) as Days

FROM...

Update: Sample attached

Capture.PNG

View solution in original post

Highlighted
Champion
Champion

One way, you can use Inline, like this?

load * inline

[Month, Days

Jan, 31

Feb, 28/29

Mar, 31

so on..

];

then you can link it or map it.

Highlighted

Hi,

another solution might be:

Day(AddMonths(Date#(Month&Year,'MMMYYYY'),1)-1) as Days

hope this helps

regards

Marco

Highlighted
Champion III
Champion III

Nice  Sunny T

Highlighted

Thanks brother