Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

convert date format

Dear friends,

how can convert the date 006.2010 in 30/06/2010??

in the table there is the period 006.2010 and I want convert in script to date 30/06/2010 and then manage this one in master calendar

can you help me

regards

gennaro

Tags (1)
4 Replies
Not applicable

convert date format

I done in this way:

Directory; CO_PA: LOAD

MonthEnd(makedate((right(Periodo, 4)), (left(Periodo, 3)))) as Data,



//Calendar

LET varMinDate = Num(Peek('MinDate'));

LET varMaxDate = Num(Peek('MaxDate'));

LET vToday = num(today());

DROP TABLE MaxMinDate;

//*************** Temporary Calendar ***************

TempCalendar:

LOAD

$(varMinDate) + rowno() - 1 AS Num,

date($(varMinDate) + rowno() - 1) AS TempDate

AUTOGENERATE $(varMaxDate) - $(varMinDate) + 1;

//*************** Master Calendar ***************

MasterCalendar:

LOAD

TempDate AS Data,

Year(TempDate)as Anno,

Month(TempDate) as Mese,

Week(TempDate) as Settimana,

'Q' & Ceil(Month(TempDate)/3) as Quarter



but there's this error:

convert date format

Can you explain a bit more how the period maps to the date? Is the period "006" month 6 and you want the monthend as date? Do you have 12 periods 1-12?

-Rob

Not applicable

convert date format

Hi Rob,

yes, all rigth

'006' is month 6 (june)

I want monthend 30/06/2010 and I have 12 period

thanks in advance

lucasvallinoto
Contributor

Re: convert date format

Hi, is that what you mean?

=MonthEndDate( Date#( '006.2010', '0MM.YYYY' ) ) )

Community Browser