I assuming the Fiscal start on April 1 to end on March 31s the next year then assuming you need output like FY2023-24 or FY2024-25 you can do the below
// Get the year and month from your Date
var $Year = parseInteger(formatDateTime($MyDate, 'yyyy'))
var $Month = parseInteger(formatDateTime($MyDate, 'MM'))
// Check if the date is not empty
if $MyDate != empty then
// Determine the fiscal year string based on the month
if $Month >= 4 then
// Fiscal year starts this year
'FY' + toString($Year) + '-' + substring(toString($Year + 1), 2)
else
// Fiscal year started last year
'FY' + toString($Year - 1) + '-' + substring(toString($Year), 2)
else
''
You can convert the return types based on your needs. Hope this helps you.