Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
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 !!!

Labels (1)
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
MVP
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
MVP
MVP

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