Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

bobbydave
Contributor II

Whats up with year

I am importing an excel sheet with 2017 text.

I am trying to convert it to a YEAR in QV and it appears as follows.

I've tried

Date#(F1, 'YYYY')     appears as 2017.00000

Date(F1, 'YYYY')       appears as 1905

Year(F1)                    appears as 1905

1 Solution

Accepted Solutions

Re: Whats up with year

Can you try this

Num(Num#(F1))

or

Num(F1 * 1)

11 Replies

Re: Whats up with year

May be try this

Year(Date#(F1, 'YYYY')) as Year

bobbydave
Contributor II

Re: Whats up with year

Appearing as blank now.

Screenshot attached

sasiparupudi1
Honored Contributor III

Re: Whats up with year

try round(F1)

bobbydave
Contributor II

Re: Whats up with year

same as above. blank

sasiparupudi1
Honored Contributor III

Re: Whats up with year

Year(Trim(Subfield(F1,'.',1)))



Year(Date#(Trim(Subfield(F1,'.',1)),'YYYY'))

Re: Whats up with year

Can you try this

Num(Num#(F1))

or

Num(F1 * 1)

niclaz79
Contributor III

Re: Whats up with year

Floor(Date#(F1, 'YYYY'))

Re: Whats up with year

It seems that your field contained a string with numbers whereby it isn't a date else it's just a year-value. Therefore try something like this:

num(F1)

or

num(num#(F1, '####.######', '', '.'))

- Marcus

Re: Whats up with year

another one:

MakeDate(F1)

Community Browser