Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
I have data table including year & month fields. i need create date filed considering month end date in script . please help me.
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);
hope this helps
regards
Marco
MonthEnd(MakeDate(Year,Month,1))
hi anbu,
error occurred in the data loading
i enclosed sample date please help.
year | month | date |
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 |
Thx
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 ] ;
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;
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
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
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);
hope this helps
regards
Marco
Instead of floor() you can also use daystart() or dayname().
Hope this helps also
Regards
Marco
Thx