Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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