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: 
Not applicable

Convert months and days into date

Hi guys,

i have 4 fields: minDay, minMonth, maxDay, maxMonth

i need to convert them into 2 fields: minDate and maxDate; so i have to join month and day in one field without the year.

I have already tried MAKEDATE but it also inserts the year (not correct!)

Can anyone help me?

Thanks,


Federica

5 Replies
antoniotiman
Master III
Master III

Hi Federica,

which are the formats of Dates ?

Not applicable
Author

‌Numbers

jonathandienst
Partner - Champion III
Partner - Champion III

Well a date value always needs a year. But you could create a custom field like

=Date(Date#(minMonth & '-' & minDay, 'MM-DD'), 'DD-MM')

(if month is a number)

=Date(Date#(minMonth & '-' & minDay, 'MMM-DD'), 'DD-MM')

(if month is a month name abbreviation)

=Date(Date#(minMonth & '-' & minDay, 'MMMM-DD'), 'DD-MM')

(if month is a full month name)

Set the output format by replacing the last 'DD-MM' in the expression with your desired format.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
antoniotiman
Master III
Master III

And the format of Min/MaxDate ? DDMM ?

Try like this

Date(MakeDate(2017,vMonth,vDay),'DDMM')

Anonymous
Not applicable
Author

ok, useful, thanks