Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

How to change date format

Hello all,

My data currently has the date listed in the following format:

Jan 29, 2017 22:01:46 EST

I'm trying to change it so it only has 1/29/2017 with no time stamp. How would I accomplish this?

Also, I'm trying to set an expression for when the date is within the last 14 days, display all the data with severity = 'high'

thank you in advance!

22 Replies
Highlighted

Re: How to change date format

May be like this

LOAD Date(Floor(TimeStamp#(SubField(DateField, ' EST', 1), 'MMM DD, YYYY hh:mm:ss'))) as Date

Highlighted
Champion III
Champion III

Re: How to change date format

Try this?

Replace the date with you datefield name.

=  Date(Date#(Replace('Jan 29, 2017 22:01:46 EST', Right('Jan 29, 2017 22:01:46 EST', 12), ' ') , 'MMM DD, YYYY'), 'MM/DD/YYYY')

OR

=  Date(Date#(Replace('Datefield', Right('Datefield', 12), ' ') , 'MMM DD, YYYY'), 'MM/DD/YYYY')

Highlighted
Specialist
Specialist

Re: How to change date format

Above Sunny's expression for Date

Date(Floor(TimeStamp#(Trim(SubField(DateField, ' EST', 1)), 'MMM DD, YYYY hh:mm:ss')))  As Date


For Severity Flag

if(Date>=Date(today()-14),'High') as [Severity Flag]

Highlighted
Not applicable

Re: How to change date format

This works, but there's also 'EDT', so all those dates with EDT are blank, how do I fix that?

Highlighted

Re: How to change date format

May be try this:

Date(Floor(TimeStamp#(SubField(DateField, ' E', 1), 'MMM DD, YYYY hh:mm:ss'))) as Date

Highlighted
Specialist
Specialist

Re: How to change date format

Try This

Date(Floor(TimeStamp#(Trim( Left(DateField,Len(DateField)-3)), 'MMM DD, YYYY hh:mm:ss')))

Highlighted
Not applicable

Re: How to change date format

hm, severity flag isn't working. this is how i was thinking to try it, but it didnt work for me:

if(New_first_discovered>=Date(today()-14) AND New_Severity = 'High'

Highlighted
Specialist
Specialist

Re: How to change date format

what are you exactly trying to achieve and also Is New_first_discovered in Date format  ??

Highlighted
Not applicable

Re: How to change date format

This worked for the date issue, thanks