Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Load date(MonthStart(Date#(dateField,'YYYYMM')),'DD.MM.YYYY') as NewDateField Inline [
dateField
201801
201802
201803
201804
];
result:
Yes, you can use Date#() function for this. It takes two parameters: a string with date value and a string defining date format. So in your exmple:
Date#('01.2018', 'MM.YYYY')
Of course you can use field names as the first parameter:
Date#(DateField, 'MM.YYYY')
Hope this helps
Juraj
try this
A:
load * Inline
[
OrdDate
01.2018
];
LOAD * ,
Date(Date#(OrdDate,'MM.YYYY'),'DD.MM.YYYY') as New
Resident A;
I don't have date field. I have only Period field from which i want to make a date field.
Date# just generate the same period
By doing so, i got blank output.
Date#() generates the same period, but makes Qlik understand it is a date field. So after using Date#() on your period field you can work with it as with date field. Try Chanty's example to see for yourself
Date(Date#(PeriodField, 'MM.YYYY'), 'DD.MM.YYYY')
can u share 5 dates you already have? exactlly how they're written; this could help us
Hi,
You need to complete the date then change it,
DATE(DATE#('01.'&DateField,'DD.MM.YYYY'),'DD.MM.YYYY') AS NewDate
This will make all your period the 1st of the month.
Mark
Then please share some real input data as this works for me.
I have period field in below format