Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
souadouert
Specialist
Specialist

DayNumberOfYear anomaly

Capture.PNG

Hello


I found an error in the static, analyzing the data and the script I found that the function DayNumberOfYear( )

gives a bizzare result



for example

DayNumberOfYear(Date(Date#('20180301','YYYYMMDD'),'DD/MM/YYYY')) 

normally the resultat gives  ->  60

012018 -> 31days 02/2018 28days    31+28+1=60

But my app shows 61 !!!

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

From QV Help:

The function always uses years based on 366 days.

View solution in original post

3 Replies
m_woolf
Master II
Master II

From QV Help:

The function always uses years based on 366 days.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

This is expected behavior. The DayNumberOfYear() function uses years based on 366 days.  That is, it considers every year to have a Feb 29 day.

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFun...

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

http://www.easyqlik.com

MarcoWedel

Hi,

maybe you could use some expression like

Date#('20180301','YYYYMMDD')-YearStart(Date#('20180301','YYYYMMDD'))+1

to get your expected result.

One remark regarding your initial expression, you may skip the formatting Date() function in case you only use the numerical part of your Date#() interpretation.

hope this helps

regards

Marco