Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
dwfiv327
Contributor II
Contributor II

Number of Days in Year

I have this statement in my load script.  It is returning 366, should be 365.  I am running the latest version of QlikView 12.10 R2.

LET vYearLength = DayNumberOfYear(YearEnd(Today()));

Any ideas on why this should be returning an incorrect value?

Is there a different function I should be using to determine the length of a year?

-Daniel Farrow

4 Replies
hector_munoz
Specialist
Specialist

Hi Daniel,

That value is correct; funtion DayNumberOfYear() always uses 366 days years.

Regards,
H

dwfiv327
Contributor II
Contributor II
Author

So, how does one reliably determine how many days are in a given year?

hector_munoz
Specialist
Specialist

This could work:

=If(Mod(Year(Today()), 4) = 0 AND Mod(Year(Today()), 100) <> 0, 366, 365)

Regards,

H

jamal_mezzourh
Partner - Contributor II
Partner - Contributor II

Hi,

Try this : round(YearEnd(Today())-YearStart(Today()))

Regards.