Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date field from Period field

Hi,

Is it possible to make a date field from period field?

Like 01.01.2018 from 01.2018

       DD.MM.YYYY     MM.YYYY

Thanks

18 Replies
Anonymous
Not applicable
Author

Logically your solution seems to be perfect but unfortunately i am getting blank result by applying it.

Miguel_Angel_Baeyens

Several options, some of these already discussed above:

Date(Date#(PeriodField, 'MM.YYYY')) AS DateField // this will produce a date like 01.01.2018 (first day of the period)

There is no need to complete this with the day or any output mask if the first day of the month is OK.

MakeDate(Right(Field, 4), Left(Field, 2)) AS DateField // again, no need to specify day, it will use the first day of the month

Miguel_Angel_Baeyens

Yep, then

Date(Date#(Period, 'YYYYMM')) AS DateField

Will store in DateField the first day of that month.

EDIT: all answers provided were enough, but the format you provided initially 'MM.YYYY' does not match with the one you provided here 'YYYYMM'.

OmarBenSalem

Load date(MonthStart(Date#(dateField,'YYYYMM')),'DD.MM.YYYY') as NewDateField Inline [

dateField

201801

201802

201803

201804

];

result:

Capture.PNG

Chanty4u
MVP
MVP

for me result like below

re.PNG

juraj_misina
Luminary Alumni
Luminary Alumni

Can you paste your expression here exactly as it is in your app?

Anonymous
Not applicable
Author

Yes sorry, it's a formatting mistake from my side provided here.

Now it works fine.

Thanks a lot!

Anonymous
Not applicable
Author

Thank you so much!

Perfect solution..

OmarBenSalem

thank please close the thread by marking the correct answer as correct and the helpful as helpful

Thanks