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

Date handling

I have a column in an Excel sheet that contains dates and partial dates, i.e. format. dd/mm/yyyy, mm/yyyy and yyyy. I would like to extract the month and year or null where there is none. Using the Year and Month functions, Qlik extracts 1905 and May, when there isn't one. Any ideas?

3 Replies
Anil_Babu_Samineni

Can you provide sample data?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

It seems QV is not reading the dates properly. Sample data would be great.

m_woolf
Master II
Master II

For year:

=if(len(DateField=10,year(DateField),

     if(len(DateField)=7,subfield(DateField,"/",2),DateField) as YearField

For month:

=if(len(DateField=10,month(DateField),

     if(len(DateField)=7,subfield(DateField,"/",1),null()) as MonthField