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: 
sajalgour2309
Contributor II
Contributor II

Convert YY/MM/YYYY to YY/MM

Hello guys,

i have a date column in my data source and it's format is YY/MM/YYYY (17/08/2017). In Qlikview i want date in YY/MM format.

Field name - OrderDate

I have tried Date((Date#(OrderDate, 'YY/MM/YYYY')), 'YY/MM') but it doesn't work.

Am i doing something wrong here ?

Sajal

12 Replies
sajalgour2309
Contributor II
Contributor II
Author

I think Date(Date#(Left(OrderDate, 5), 'YY/MM'), 'YY/MM') is not working because OrderDate is not text like '16/08/2017' it's actual date like 42963.

As you suggested sunny I have tried Date(Date#(Left('16/08/2017', 5), 'YY/MM'), 'YY/MM') and it worked.

but it won't work when i will pass OrderDate.

sunny_talwar

Then may be try this

Date(Date#(Left(Date(OrderDate, 'DD/MM/YYYY'), 5), 'YY/MM'), 'YY/MM')

sajalgour2309
Contributor II
Contributor II
Author

Great. It works fine.

Thanks a lot Sunny and others.