Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have data for multiple Reporting years in my table in Oracle DB called tbl_Sales, I need to load data for only latest year.
I am trying the below script; however, not sure data is not getting loaded in the 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 "tbl_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);
Drop Table TEMP;
Drop Table File_status;
I am new to Qlik Sense, any help would be much appreciated.
Please try the below code:
File_status:
LOAD
RPT_YEAR,
SELECT
RPT_YEAR,
FROM "tbl_Sales" ;
TEMP:
LOAD
Max(RPT_YEAR) as Current_Year
Resident File_status;
LET v_max_year = floor(peek('Current_Year'));
NOCONCATENATE
Final:
Load *
Resident File_status
where RPT_YEAR = $(v_max_year);
Drop Table TEMP;
Drop Table File_status;
@hesh - Thank you!
Please try the below code:
File_status:
LOAD
RPT_YEAR,
SELECT
RPT_YEAR,
FROM "tbl_Sales" ;
TEMP:
LOAD
Max(RPT_YEAR) as Current_Year
Resident File_status;
LET v_max_year = floor(peek('Current_Year'));
NOCONCATENATE
Final:
Load *
Resident File_status
where RPT_YEAR = $(v_max_year);
Drop Table TEMP;
Drop Table File_status;
@hesh - Thank you!