Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Joining fields to create date

Hi,

I have two date fields:

Mat_Year = format YYYY

Mat_Month = format MM

Please can someone help me to join these fields together to create a field in the format MMM-YY.

Thanks,

Daniel

4 Replies
sunny_talwar

May be this

Date(Date#(Mat_Year&'-'&Mat_Month, 'YYYY-MM'), 'MMM-YY') as Mat_MonthYear

kfoudhaily
Partner - Creator III
Partner - Creator III

hello,

in the loading script, in the same table where you are loading these two fields you may add the flowing statement:

date#(Mat_Month&'/'&Mat_Year,'MM/YYYY') as Date

fonction date# to force qlik to read the field as a date and not a string;

regards,

QlikView Qlik Sense consultant
danielnevitt
Creator
Creator
Author

Hi Sunny,

That works great, thanks for your help.

The only issue I have is that the format is Mmm-YY (Jan-18) rather than MMM-YY (JAN-18).

Is it possible for the output to be in format MMM-YY

Regards,

Daniel

sunny_talwar

Sure.... all you need to do is to change your environmental variable from

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

to

SET MonthNames='JAN;FEB;MAR;APR;MAY;JUN;JUL;AUG;SEP;OCT;NOV;DEC';