Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Yet another date question...

Hello all!

I have a question regarding dates. I have an excel with a date column ' 2010-04-01' and I would like to use the year and month from this field so I would like to have '2010-04'. I thought this would be the solution but it doesn't work:


date(date#(left(Date, 7), 'YYYY-MM'), 'YYYY-MM') as %CurrencyPeriod


This results in a '-'

Any suggestions of how I could do this?

Br

Cristian

1 Solution

Accepted Solutions
martin59
Specialist II
Specialist II

Year(Date)&'-'&num(Month(Date)) as [%CurrencyPeriod]


View solution in original post

4 Replies
martin59
Specialist II
Specialist II

Hi,

I think you have to use this expression :

Year(Date)&'-'&Month(Date) as [%CurrencyPeriod]


Not applicable
Author

Thank you but this results in: '2010-apr'. How can I convert the month to a number?

Br

Cristian

martin59
Specialist II
Specialist II

Year(Date)&'-'&num(Month(Date)) as [%CurrencyPeriod]


Not applicable
Author

Great! Thank you!

Br

Cristian