Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sonysree88
Creator II
Creator II

Date format changes

Hi Everyone,

Could you please resolve this issue..

in my dashboard i have the date feild data like this Tue-06-2016 01.52.10 AM

am unable to extract from this date to years or months any another extraction

It would be appreciate if it solved ASAP

written expression as : Year(Date field)

Month(Date Field)

Thanks

Sonysree

10 Replies
susovan
Partner - Specialist
Partner - Specialist

Hi sonygot,

You can try this below way,

Date(Date Field,'DD/MM/YYYY')

Warm Regards,
Susovan
sonysree88
Creator II
Creator II
Author

Hi Ghosh,

Tried it not working..data is coming from hive

Kushal_Chawda

try this

Year(date#(trim(mid(Field,index(Field,'-',1),index(Field,' ',1))),'MM-YYYY')) as Year

month(date#(trim(mid(Field,index(Field,'-',1),index(Field,' ',1))),'MM-YYYY')) as Month

arulsettu
Master III
Master III

maybe like this

load *,

month(date) as month,

year(date) as year;

timestamp(timestamp#(mid('Tue-06-2016 01.52.10 AM',5),'MM-YYYY hh.mm.ss TT'),'MMM/DD/YYYY') as date

sonysree88
Creator II
Creator II
Author

Tried it not working am unable to extract something from date

How can i get the weeks from date filed

I am using like weekday(Date filed)

antoniotiman
Master III
Master III

Try

Month(Date#('01'&PurgeChar(DateField,SubField(DateField,'-',1)),'DD-MM-YYYY hh.mm.ss tt'))

muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Date(floor(Date_Field))

Year(Date(floor(Date_Field)))

Month(Date(floor(Date_Field)))

Muthukumar Pandiyan
arulsettu
Master III
Master III

can you post sample data

muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Can you give me sample qvw file?

You can use Week(Date_Field).

Muthukumar Pandiyan