Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Format Date 'YYYY-MM-DD' to 'YYYY-MM'

Hi,

i have big problem using QV script code. Im trying to change date from 2015-01-01 for 2015-01.

My field with Date is "Data".

I was trying to use formulas date(Data,'YYYY-MM') but still after exporting to excel it shows YYYY-MM-DD format.

I was also trying to use makedate function with year (year is 1905) and after that i received 1905-01-01.

Do you maybe have similar issue to mine?

Thank you in advance for your help,

Jacek Antek

2 Replies
sunny_talwar

Try this maybe:

Date(MonthStart(Date#(Data, 'YYYY-MM-DD')), 'YYYY-MM') as DateField

Anonymous
Not applicable
Author

If you are fetching it from Excel, then do like this?

=date(date#(Data,'Excel Date Format'), 'YYYY-MM') as DataField