Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month Function With String

Hello,

Brand new to QlickView and found the Out Of The Box demo to be very helpful getting started.  The demo uses the MONTH function to obtain month from a date field but I can't get it to work with a string.  During the load process:

  • Timestamp#(payment_date, 'mm/dd/yyyy hh:mm:ss') as payment_date,
    This converts the string to a date field.
  • year(Timestamp#(payment_date, 'mm/dd/yyyy hh:mm:ss')) as year,
    This converts the string to a date field and provides the correct year
  • month(Timestamp#(payment_date, 'mm/dd/yyyy hh:mm:ss')) as month,
    Not sure what this did!  My list box only shows 'Jan' when I expected all 12 months.

Can someone explain why I don't get these values in my list box?

Cheers,

-Keith

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Take care of the format codes for Month 'MM' vs minutes 'mm'.

month(Timestamp#(payment_date, 'MM/DD/YYYY hh:mm:ss')) as month,

View solution in original post

4 Replies
swuehl
MVP
MVP

Take care of the format codes for Month 'MM' vs minutes 'mm'.

month(Timestamp#(payment_date, 'MM/DD/YYYY hh:mm:ss')) as month,

sureshbaabu
Creator III
Creator III

Hello,

can you please try the following : =month(date(floor(date_col)))


Thanks

Colin-Albert

As swuehl says mm refers to minutes, MM to month!

I always use uppercase for date formats, lowercase for time formats to avoid this confusion.

date(date#(payment_date, 'MM/DD/YYYY hh:mm:ss')) as payment_date,

year(date#(payment_date, 'MM/DD/YYYY hh:mm:ss')) as year,
month(date#(payment_date, 'MM/DD/YYYY hh:mm:ss')) as month

Not applicable
Author

Is there a big difference between date# and timestamp#?