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() function

Hi, I'm confused about how/when to use this function.  Any tips?

1 Solution

Accepted Solutions
Not applicable
Author

You can use like

Date(Date#(Month,'YYYY-MM'),'MM') should give you Month number

View solution in original post

9 Replies
Not applicable
Author

You can use Date() any time you need to manipulate a date field format

Date(sale_timestamp,'YYYY-MM') would give you 2013-10


Not applicable
Author

If you have a specific question or example you need help with please post it and I would be happy to help if I can

Not applicable
Author

Thank you.  So, another option would be Date(sale_timestamp,'MM') to get just the month- is that right?

Not applicable
Author

Yes, you can also use Month(sales_timestamp)

Not applicable
Author

Date: When you are getting your date data as number then sipmly you can use data function to format.

Date#: When you are getting your date data as string /expression then this function Evaluets the expression and give date based on format provided

Not applicable
Author

This is my issue:

Monthly_Exchange_Rates:

Load

Currency,

Date#(Month, 'YYYY-MM') as [Year-Month],

Mid(Month, 6, 2) as MonthNum, /*This worked, but is there another way? Month(Month) just gives a "-" */

Rate

Inline [

Currency, Month, Rate

EUR, 2013-05, 1

EUR, 2013-07, 1

EUR, 2013-06, 1

EUR, 2013-09, 1

EUR, 2013-08, 1

Not applicable
Author

I have this:

Date#(Month, 'MM') as MonthNo2

Where the Month field is 'YYYY-MM' format.  I want ONLY  the month part.  But it's not happening.

Not applicable
Author

You can use like

Date(Date#(Month,'YYYY-MM'),'MM') should give you Month number

Not applicable
Author

I appreciate that. Thanks.