Need to load data only for max(year) in QlikSense load script
I have data for multiple Reporting years in my oracle table year_sales, I need to load data for only latest year. I am trying below script, however, not sure data is not getting loaded in Final table. Please guide me, I am not able to identify if I have made any silly mistake.
File_status: LOAD RPT_YEAR, SELECT RPT_YEAR, FROM "Year_sales" ;
TEMP: LOAD Max(RPT_YEAR) as Current_Year Resident File_status;
LET v_max_year = floor(peek('Current_Year'));
Final: Load * Resident File_status where RPT_YEAR = $(v_max_year);