Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Monthend date from Month

Hi,

We have aggregated sales data in database itself due to performence and pulled that data in qlik.

We have only Calender_Month date field was available.

When i try to ectract monthend dates from month using below

MonthEnd(Calender_Month )

It giving wrong dates.

Is there any other way to get dates from Calender_Month .

Thanks..

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Time god, Finally you will be conclusion stage, Try this?

Date(Date#('201708', 'YYYYDD'),'DD-MMM-YYYY')


Or Even this can be work

Date(MonthEnd(MakeDate(Left(FieldName, 4), Right(FieldName,2))), 'DD-MMM-YYYY')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

15 Replies
Anil_Babu_Samineni

What you mean wrong dates? And, can you explain the data you have and you can use MonthEnd(DateField) ..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
nareshthavidishetty
Creator III
Creator III
Author

Hi ,

We have

Calender_Month as 1,2,3,4,5,6,..

When I'm tring to do the below

Monthend(Calender_Month)

It gives wrong dates.

Thanks...

YoussefBelloum
Champion
Champion

the MonthEnd fuction takes a Date not a month

pradosh_thakur
Master II
Master II

=monthend(MakeDate(year(today()),Calender_Month,1))

Learning never stops.
Anil_Babu_Samineni

You can read this makedate ‒ QlikView

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresesco
MVP
MVP

If you wish to get the last day of the month from a numeric month field, you can try like:

Day(MonthEnd(Date#(Calendar_Month,'M')))


This will give 31 for the months 1,3,5..  and 30 or 28 accordingly for such months. However, if you want a date, there has to be a year element also in the source. If you have it in the field you could use makedate() or date#() for the same like:

MonthEnd(MakeDate(Year, Calendar_Month))

nareshthavidishetty
Creator III
Creator III
Author

Hi,

We have only these fields in table

SELECT Calendar_Month,

Month_Material_Count,

ConformedType

FROM XXXX.XXX


Is it possible to extract date from Calendar_Month


Calendar_Month detail  1,2,3,4..


Thanks..

pradosh_thakur
Master II
Master II

did you try this

=monthend(MakeDate(year(today()),Calender_Month,1))

Learning never stops.
nareshthavidishetty
Creator III
Creator III
Author

Yeah I have tried.

It gives only for year..but I do have data from past 3 years.

May be because of year(today()).

Thanks..