Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

kshitijas
Contributor

Date ()

Hello everyone,


i have date in following format 07/09/2016 08.55 PM need to find the month and year for the following date.Made use of the Function Month(),Year(), Date(Date#([Date field], 'dd/MM/yyyy hh.mm pp'), 'M/d/yyyy') as open_Date but all are giving blanks.Can anyone Suggest?.

Thanks in advance!!

1 Solution

Accepted Solutions
MVP
MVP

Re: Date ()

Sunny is correct, except I think you have a period instead of a colon for a date separator.

=Date(Date#([Date field], 'dd/MM/yyyy hh.mm TT'), 'M/d/yyyy')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
5 Replies

Re: Date ()

Try this:

Month(Date#([Date field], 'dd/MM/yyyy hh:mm TT')) as Month,

Year(Date#([Date field], 'dd/MM/yyyy hh:mm TT')) as Year,

Date(Floor(Date#([Date field], 'dd/MM/yyyy hh:mm TT'))) as Date,

TimeStamp(Date#([Date field], 'dd/MM/yyyy hh:mm TT')) as TimeStamp

kshitijas
Contributor

Re: Date ()

Hello Sunny,

I tried doing this but it comes as blank

shraddha_g
Honored Contributor III

Re: Date ()

Try:

month(date(floor(TImestamp#([Date field],'DD/MM/YYYY hh.mm TT')))) as Month,

year(date(floor(TImestamp#([Date field],'DD/MM/YYYY hh.mm TT')))) as Year

I hope it is helpful.

MVP
MVP

Re: Date ()

Sunny is correct, except I think you have a period instead of a colon for a date separator.

=Date(Date#([Date field], 'dd/MM/yyyy hh.mm TT'), 'M/d/yyyy')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
kshitijas
Contributor

Re: Date ()

Thankyou Jonathan , even Sunny was right had a period instead of a colon for date separator.