Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Date which doesnt look like date

Hi everyone...

I'm a new QV user...

and i have a problem wiht a date.

If one of you can help me would be great.

The fact is that I have a Date, which format is something like this

1010224.

the first position is century, next two are year, next two are month and last two day.

I need to convert it to a date format

how i can do it???

thanks...

Angela E

Colombia

Tags (1)
1 Solution

Accepted Solutions
erich_shiino
Honored Contributor

Date which doesnt look like date

On the script, you can use makedate() to create a date based on year, month and day.

The syntax is makedate( Year, Month, Day)

In your case, I didn't understand how to get the Year,

Is your example 24/feb/2001 ?

or 24/feb/0001?

But it would be something like this:

makedate(    2000+( 100* (LEFT( YOUR_DATE_FIELD, 1)-1)) + mid(YOUR_DATE_FIELD,2,2), 

mid(YOUR_DATE_FIELD, 4,2), RIGHT( YOUR_DATE_FIELD, 2) )

Sorry if I forgot some ( or )

Hope it helps,

Erich

2 Replies
erich_shiino
Honored Contributor

Date which doesnt look like date

On the script, you can use makedate() to create a date based on year, month and day.

The syntax is makedate( Year, Month, Day)

In your case, I didn't understand how to get the Year,

Is your example 24/feb/2001 ?

or 24/feb/0001?

But it would be something like this:

makedate(    2000+( 100* (LEFT( YOUR_DATE_FIELD, 1)-1)) + mid(YOUR_DATE_FIELD,2,2), 

mid(YOUR_DATE_FIELD, 4,2), RIGHT( YOUR_DATE_FIELD, 2) )

Sorry if I forgot some ( or )

Hope it helps,

Erich

Not applicable

Date which doesnt look like date

Thanks a lot !!!