I have data like below,
Business | year | Profit |
Cards | 2025 | 19.90% |
Cards | 2026 | 18.10% |
Cards | 2027 | 17.30% |
Cards | 2028 | 16.50% |
Cards | 2029 | 16.50% |
Loans | 2025 | 53.30% |
Loans | 2026 | 53.10% |
Loans | 2027 | 51.80% |
Loans | 2028 | 51% |
Loans | 2029 | 51% |
Now I want to Filter this data based on the year, not using conditions like year='2025', It should be dynamic, the data will have five years 2025 - 2030 and data needs to be filtered for all years and written to different sheets of an excel, like if 2025 data then the sheet name should be like FY25, if 2026 then sheet name should be like FY26 etc. Is this possible? and is it possible to dynamically populate sheet names while using a visual layout solution?
To Dynamically filter the years you can use the following formula.
[year] > tonumber(DateTimeTrim(DateTimeNow(),'%Y')) and [year]<= tonumber(DateTimeAdd(DateTimeNow(),6,'years'))
To create the tabs you can create a new field in your data set to generate the sheet name for the filepath.
(Formula field name: [TabName])
'FY'+Right(ToString([year]), 2)
To create the sheet names you can use the following formula.
[Engine.WorkflowDirectory]+' <Insert FileName Here> '+".xlsx|||"+[TabName]
And in the Output tool check the box to "Take File/Table name from field".