Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
May be like this
LOAD Date(Floor(TimeStamp#(SubField(DateField, ' EST', 1), 'MMM DD, YYYY hh:mm:ss'))) as Date
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')
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]
This works, but there's also 'EDT', so all those dates with EDT are blank, how do I fix that?
May be try this:
Date(Floor(TimeStamp#(SubField(DateField, ' E', 1), 'MMM DD, YYYY hh:mm:ss'))) as Date
Try This
Date(Floor(TimeStamp#(Trim( Left(DateField,Len(DateField)-3)), 'MMM DD, YYYY hh:mm:ss')))
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'
what are you exactly trying to achieve and also Is New_first_discovered in Date format ??
This worked for the date issue, thanks