I’m using the below expression to derive the enterprise’s fiscal year-end date dynamically based on the current date:
TO_DATETIME(
CONCAT(
TRIM(TRAILING FROM CAST(
CASE
WHEN MONTH(CURRENT_DATE) IN (1, 2, 3) THEN YEAR(CURRENT_DATE) - 1
ELSE YEAR(CURRENT_DATE)
END AS CHAR
)),
'/03/31'
),
'YYYY/MM/DD'
)
This logic works correctly, but when I use it in other dependent calculations, the queries take around 3–5 minutes to load and display results
However, when I replace it with a constant date value like below, it performs much faster:
TO_DATE('2025/03/31', 'YYYY/MM/DD')
Is there a recommended way to optimize or handle such dynamic date calculations in FDI to avoid performance issues?