Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to use the DayNumberOfYear function for making expression calculating the number of days until someone has a birthday. In order to make the calculation work properly I also need to check whether the current year, and the year the person was born in was a leap year. I have however found that using DayNumberOfYear(YearStart()) with any years other than the current one will return 366, shouldn't this return 1? I have also found that using DayNumberOfYear(YearEnd()) is always 365 regardless of whether the date I put in is a date in a leap year or not.
DayNumberOfYear: Returns the day number of the year according to a timestamp with the first millisecond of the first day of the year containing date. The function always uses years based on 366 days.
Strange logic from the QlikView Developers.
Getting the number of days between to dates
See above post.
Hi Dargun,
I know this is late in the day but I've just had to do something similar relating to Day of Year.
To work out the leap year you could take advantage of the Mod function
IF(Mod(Year(DateEntered),4) = 0 , 'Leap Year', 'Not Leap Year')
though to be really accurate you'd have to add a bit to ignore when Mod Year 100 = 0 unless Mod Year 400 = 0 but that is maybe forecasting a bit too far into the future depending on the app