Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

date to yyyy-mon

I've tried the following in my script:

Started as SessionStart,
date(makedate(Year(Started),Month(Started)),'YYYY-MMM') as Chat_Resp_YrMon,

This is the result: 

chat.PNG

What do I need to do to roll up my data  to yyyy-mmm?  My end goal is to show sessions in the month on a graph

11 Replies
antoniotiman
Master III
Master III

Hi John,

if You set in Script Your Format Timestamp like this

SET TimestampFormat=YYYY-MM-DD hh:mm:ss[.fff]';   // or YYYY-DD-MM

then

LOAD Date(Floor(Date(Started)),'YYYY-MMM') as Chat_Resp_YrMon

Regards,

Antonio

sibusiso90
Creator III
Creator III

can you a send a sample of your data.

Not applicable
Author

Sorry, this did not work...I get the same result:

SET TimestampFormat = 'YYYY-MM-DD hh:mm:ss[.fff]';
LOAD Started as SessionStart,
Date(Floor(Date(Started)),'YYYY-MMM') as Chat_Resp_YrMon,

chat.PNG

sasiparupudi1
Master III
Master III

Date(Floor(timestamp#(Started,'YYYY-MM-DD hh:mm:ss')),'YYYY-MM') as Chat_Resp_YrMon


ex:

=Date(Floor(timestamp#('2017-02-03 00:56:2','YYYY-MM-DD hh:mm:ss')),'YYYY-MM')

Not applicable
Author

Same result, it does not recognize the year:

LOAD Started as SessionStart,
Date(Floor(timestamp#(Started,'YYYY-MM-DD hh:mm:ss')),'YYYY-MM') as Chat_Resp_YrMon,

chat.PNG

sibusiso90
Creator III
Creator III

Send the data sample then will offer guided help

Not applicable
Author

Sorry, I am not sure how to do that.

sasiparupudi1
Master III
Master III

It works fine with your sample date(please see attached)

sunny_talwar

Try this

Date(MonthStart(TimeStamp#(Started, 'YYYY-MM-DD hh:mm:s')), 'YYYY-MMM') as Chat_Resp_YrMon