Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Darren1
Contributor III
Contributor III

Populate a new fiscal year field using the date field

My goal is to populate the new [report_date_fiscalyear] field using the [report_date] field. Is this something I can create in the Load Script?

  • If a date falls between July 1, 2022, and June 30, 2023, the [report_date_fiscalyear] will populate with 2023
  • If a date falls between July 1, 2021, and June 30, 2022, the [report_date_fiscalyear] will populate with 2022
  • If a date falls between July 1, 2020, and June 30, 2021, the [report_date_fiscalyear] will populate with 2021
  • Etc.

I tried using the IF() function but could not find an expression to allow 3+ fiscal years. The function failed when I added additional fiscal year expressions. I'm assuming this is because the "or" function is Boolean. Thanks in advance! 

Darren1_1-1671651622522.png

Darren1_0-1671651446309.png

 

Labels (2)
1 Solution

Accepted Solutions
Darren1
Contributor III
Contributor III
Author

Solved it! I used the IntervalMatch() with the report_date. When I add the report_date_AGOLfiscalyear field to my table, it displays the correct amount of records along with their fiscal year.

Darren1_0-1671822457159.png

 

View solution in original post

1 Reply
Darren1
Contributor III
Contributor III
Author

Solved it! I used the IntervalMatch() with the report_date. When I add the report_date_AGOLfiscalyear field to my table, it displays the correct amount of records along with their fiscal year.

Darren1_0-1671822457159.png