Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
What should be the logic/formula to be used to have a fiscal year filter on the application.
Filter is created on the application, now as a next step need to implement formula to calculate the fiscal year from the given date & time formula column. Format of the date in table (Format - 01-04-2023 05:45).
Hi please follow these steps:
1. Load Data: Ensure your data is loaded into QlikSense, including the date and time column.
2. Create Fiscal Year Field: Use the YearName function to create a fiscal year field. Since your fiscal year starts in April, you can use the following script in the data load editor:
LOAD
DateField,
YearName(DateField, 0, 4) AS FiscalYear
FROM [YourDataSource];
Replace `DateField` with the actual name of your date and time column.
3. Add Fiscal Year Filter:Go to your sheet and add a filter pane then Select the FiscalYear field you created.
4. Expression for Fiscal Year Calculation: If you need to calculate the fiscal year dynamically in expressions, use the following logic:
IF(Month(DateField) >= 4, Year(DateField) & '-' & Year(DateField) + 1, Year(DateField) - 1 & '-' & Year(DateField)) AS FiscalYear
hope this helps.