Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

I want to seprate date and time from a column

Hello all,

The problem here is I have a colum which is displaying data as

msg_rcpt_log

10-03-2013 10:21
17-07-2015 18:40
20-07-2015 17:30
20-07-2015 21:49
20-07-2015 21:57

Now I want to get the dates only so that whenever I click on that date I can get the analytics for that.

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: I want to seprate date and time from a column

To remove the time portion, you must use Floor and NOT just formatting functions. Formatting functions can hide the display of time, but the underlying value still contains the time portion.

To get the time only, use Frac().

IMHO string mangling is unnecessary as QV/QS are well equipped with date functions.

Date(Floor(myDate))

Time(Frac(myDate))

If the date/time is not recognised, then use the recognition functions:

Date(Floor(TimeStamp#(myDate, 'YYYY-MM-DD hh:mm')))

Time(Frac(TimeStamp#(myDate, 'YYYY-MM-DD hh:mm')))


Also, see:

Why don’t my dates work?


10 Replies
Not applicable

Re: I want to seprate date and time from a column

LOAD * INLINE [

    time

   

10-03-2013 10:21







17-07-2015 18:40







20-07-2015 17:30







20-07-2015 21:49







20-07-2015 21:57



  

]
;



load SubField(time,'-',1) as day

Resident date;



Not applicable

Re: I want to seprate date and time from a column

dates are many I have just gave few for example, So do I  have to Load all the date??

no special command so that time gets a cut off from there?

sushil353
Honored Contributor II

Re: I want to seprate date and time from a column

Hi,

Try this:

Time(Date#(DateField,'MM-DD-YYYY hh:mm')) as Time

Date(Date#(DateField,'MM-DD-YYYY hh:mm')) as Date

HTH

sushil

sasiparupudi1
Honored Contributor III

Re: I want to seprate date and time from a column

try

trim(SubField(yourdateField,' ',1)) as MyDate

Not applicable

Re: I want to seprate date and time from a column


date:

LOAD * INLINE [

    time
10-03-2013 10:21

17-07-2015 18:40
20-07-2015 17:30
20-07-2015 21:49
20-07-2015 21:57

]
;



//load SubField(time,'-',1) as day,

load date(timestamp#(time,'DD-MM-YYYY hh:mm'),'DD') as day1

Resident date;



Not applicable

Re: I want to seprate date and time from a column

Not getting any of it I hav 500 rows in that column how can I use inline with this many rows any simple way to go

MVP
MVP

Re: I want to seprate date and time from a column

To remove the time portion, you must use Floor and NOT just formatting functions. Formatting functions can hide the display of time, but the underlying value still contains the time portion.

To get the time only, use Frac().

IMHO string mangling is unnecessary as QV/QS are well equipped with date functions.

Date(Floor(myDate))

Time(Frac(myDate))

If the date/time is not recognised, then use the recognition functions:

Date(Floor(TimeStamp#(myDate, 'YYYY-MM-DD hh:mm')))

Time(Frac(TimeStamp#(myDate, 'YYYY-MM-DD hh:mm')))


Also, see:

Why don’t my dates work?


sasiparupudi1
Honored Contributor III

Re: I want to seprate date and time from a column

Post your application so that we can understand better what the issue is and advise you accordingly

Not applicable

Re: I want to seprate date and time from a column

Thank you so very much and ya thank you all for giving me solutions XOXO

Regards,

Cyrus .Smiley Happy