Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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

Tags (1)
5 Replies
antoniotiman
Honored Contributor III

Re: Convert months and days into date

Hi Federica,

which are the formats of Dates ?

Not applicable

Re: Convert months and days into date

‌Numbers

MVP
MVP

Re: Convert months and days into date

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.

antoniotiman
Honored Contributor III

Re: Convert months and days into date

And the format of Min/MaxDate ? DDMM ?

Try like this

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

perporqlik
New Contributor

Re: Convert months and days into date

ok, useful, thanks

Community Browser