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: 
Anonymous
Not applicable

Total number of days in current year

Hi.

Is there a way of getting the total number of years in the year we are in now? So that i can figure out if the current year is a leap year or not.

5 Replies
MK_QSL
MVP
MVP

=Interval(YearEnd(Today()) - YearStart(Today()),'dd')

or

=IF(Interval(YearEnd(Today()) - YearStart(Today()),'dd')>=365,'Leap Year', 'Not a Leap Year')

or

=IF(FLOOR(YearEnd(Today())) - FLOOR(YearStart(Today()))=365,'Leap Year','Not a Leap Year')

Anonymous
Not applicable
Author

I get 364 as output from:
=Interval(YearEnd(Today()) - YearStart(Today()),'dd')

Not applicable
Author

Hi,

to get the number of days in current Year use this expression

=floor(Num(YearEnd(Today()))-Num(YearStart(Today()))) + 1

MK_QSL
MVP
MVP

Check my other replies also...

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

We can decide the Leap Year, based on the year itself.

=If((Mod(vYear, 100) and not Mod(vYear, 4)) or not Mod(vYear, 400), 'Leap Year', 'Not a Leap Year' )

Where vYear is variable equals some number like 2012 or expression like Year(Today())