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: 
micsim123
Contributor III
Contributor III

Fiscal year YTD

Hi!

I have a fiscal calendar starting October 1. st.

How can I make a flag field which flags all dates in "YearToDate" for current and all previous years.

When I use this formula, it only flags the dates from 2018 October 1. to current day (2019 January 12.) 

if(InYearToDate(Date,today(),0,10),1,0) as YTD

I want to flag all dates for October 1. to January 12, in all previous years in my calendar.

 

Whit my normal calendar I can do this with:

if (DayNumberOfYear(Date) <= DayNumberOfYear(Today()), 1, 0) as YTD 

 

Any ideas?

Thanks

Michael

 

Labels (2)
1 Solution

Accepted Solutions
zzyjordan
Creator II
Creator II

Hi, Michael
Then try this

if(Date-if(Month(Date)>=10,MakeDate(Year(Date),10,1),MakeDate(Year(Date)-1,10,1)) <=
(Today()-if(Month(Today())>=10,MakeDate(Year(Today()),10,1),MakeDate(Year(Today())-1,10,1))),1,0
) as FYTD_Flag

Hope this helps
ZZ

View solution in original post

5 Replies
zzyjordan
Creator II
Creator II

Hi, Michael
try this
if(InYearToDate(Date,AddYears(today(),-1),0,10),1,0) as PYTD

Hope this helps
ZZ
micsim123
Contributor III
Contributor III
Author

Hi ZZ,

Thanks, but it only flags the dates in previous fiscal year (dates from 2017 October 1.  to  2018 January 12.).

My calendar begins in 1999, and for each fiscal year, I want to flag the dates from October 1. to  January 12. (= ToDay() ).

Best

Michael

 

zzyjordan
Creator II
Creator II

Hi, Michael
Then try this

if(Date-if(Month(Date)>=10,MakeDate(Year(Date),10,1),MakeDate(Year(Date)-1,10,1)) <=
(Today()-if(Month(Today())>=10,MakeDate(Year(Today()),10,1),MakeDate(Year(Today())-1,10,1))),1,0
) as FYTD_Flag

Hope this helps
ZZ
micsim123
Contributor III
Contributor III
Author

Hi ZZ,

Thank you, it works fine.

Best, Michael

ClickNorth
Contributor
Contributor

I have a Fiscal year PNL problem that I require help with. 

My Fiscal Year ends the 6th Apr.

I need to SUM PNL for the Fiscal Year to date.

e.g. If 5th Apr selected, it would sum all PNL up to that date.

But once the 6th Apr is selected I want to not include anything prior to it.

Any help would be much appreciated.