Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

need update day

hi,

I have data table including year & month fields. i need create date filed considering month end date in script . please help me.

1 Solution

Accepted Solutions
MarcoWedel

Hi,

if you want real dates (integer, non fractional values, i.e. time = 00:00:00), then you have to purge the time values e.g. like:

LOAD year,

    month,

    Date(Floor(MonthEnd(MakeDate(year,month)))) as date

FROM [http://community.qlik.com/thread/138803] (html, codepage is 1252, embedded labels, table is @1);

QlikCommunity_Thread_138803_Pic1.JPG.jpg

hope this helps

regards

Marco

View solution in original post

9 Replies
anbu1984
Master III
Master III

MonthEnd(MakeDate(Year,Month,1))

Not applicable
Author

hi anbu,

error occurred in the data loading

i enclosed sample date please help.

yearmonthdate
20111
20112
20113
20114
20115
20116
20121
20122
20123
20124
20125
20126
20131
20132
20133
20134
20135
20136

Thx

anbu1984
Master III
Master III

Load *,MonthEnd(MakeDate(year,month,1)) As Date Inline [

year,month

2011,1

2011,2

2011,3

2011,4

2011,5

2011,6

2012,1

2012,2

2012,3

2012,4

2012,5

2012,6

2013,1

2013,2

2013,3

2013,4

2013,5

2013,6 ] ;

PradeepReddy
Specialist II
Specialist II

try something like this..

Temp_Data:

Load * inline

[

Year,Month

2011,1

2011,2

2011,5

2012,7

2012,8

];

Main_data:

load *,

monthend(makedate(Year,Month,1)) As Month_End

resident Temp_Data;

Drop table Temp_Data;

ashfaq_haseeb
Champion III
Champion III

Like this

Load*,MonthEnd(MakeDate(year,month,1)) as Date;

LOAD year,

     month

    // date

FROM

[http://community.qlik.com/thread/138803]

(html, codepage is 1252, embedded labels, table is @1);

Have a look at attached document

Regards

ASHFAQ

PrashantSangle

Hi,

If you want Month End Date

Then Try like

MonthEnd(MakeDate(Year,Month)) AS Month_End

If you want to change the format

USe date()

Like

date(MonthEnd(MakeDate(Year,Month)),'DD-MMM-YYYY')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MarcoWedel

Hi,

if you want real dates (integer, non fractional values, i.e. time = 00:00:00), then you have to purge the time values e.g. like:

LOAD year,

    month,

    Date(Floor(MonthEnd(MakeDate(year,month)))) as date

FROM [http://community.qlik.com/thread/138803] (html, codepage is 1252, embedded labels, table is @1);

QlikCommunity_Thread_138803_Pic1.JPG.jpg

hope this helps

regards

Marco

MarcoWedel

Instead of floor() you can also use daystart() or dayname().

Hope this helps also

Regards

Marco

Not applicable
Author

Thx