Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Date from Timestamp in qlik sense

Hi All,

I have a column having data in the format 2015-12-24T12:49:38+00:00. I want to extract date (2015-12-24) from this column. I have tried various functions (timestamp, timestamp#, etc) but none helped.

Could anyone help me get a solution for this.

Thanks in advance.

6 Replies
MVP
MVP

Re: Date from Timestamp in qlik sense

Out of many possible ways, try :

MakeDate(SubField(YourDataField,'-',1), SubField(YourDataField,'-',2),TextBetween(YourDataField,'-','T')) as Date

reddys310
Honored Contributor II

Re: Date from Timestamp in qlik sense

Hi Disha,

You can even try this:

date(floor(date#('2015-12-24 12:49:38', 'YYYY-MM-DD hh:mm:ss')),'YYYY-MM-DD')

Not applicable

Re: Date from Timestamp in qlik sense

Hi Tresesco,

I tried your solution but i am getting null as a result.

img.jpg

Regards,

Disha

simondachstr
Valued Contributor III

Re: Date from Timestamp in qlik sense

To offer you another alternative (without suggesting it's the best):

Subfield(Data,'T',1) AS Date

This will work if T is a definitive separator between your Date & Time

MVP
MVP

Re: Date from Timestamp in qlik sense

Try like:

Date(Date#(SubField(trim(endTime), 'T',1), 'YYYY-MM-DD')) As Date

reddys310
Honored Contributor II

Re: Date from Timestamp in qlik sense

Hi Disha,

You need to format the enddate field befor you use these functions.

Try this:

date(date#(left(endTime,10),'YYYY-MM-DD'),'YYYY-MM-DD')

Community Browser