Abinitio Interview Question 44
Abinitio Interview Question 44
Take the 2 dates and create end date for first and last quarter.
(First date of the quarter , Last Date of the quarter)
There will be 2 output fields in the output file.
DATE1 = 25102022
DATE2 = 24082023
fqdt=25102022 ==> 01102022
lqdt=24082023 ==> 30092023
Yr_part1=2022 = string_Substring(DATE1,5,4);
Yr_part2=2023 = string_Substring(DATE2,5,4);
let string(",")[int] quarter_dates1=["0101"+Yr_part1,'0104'+Yr_part1,'0107'+Yr_part1,'0110'+Yr_part1];
let string(",")[int] quarter_dates2=["3112"+Yr_part2,'3009'+Yr_part2,'3006'+Yr_part2,'3103'+Yr_part2];
for (i,i<4)
begin
qstartdt = if((date("DDMMYYYY))quarter_dates1[i]<(date("DDMMYYYY))fqdt) (date("DDMMYYYY))quarter_dates1[i];
qenddt = if((date("DDMMYYYY))quarter_dates2[i]>(date("DDMMYYYY))lqdt) (date("DDMMYYYY))quarter_dates2[i];
end;
For More Abinitio, AWS, Database content please visit my youTube channel.
https://www.youtube.com/@datapundit
@datapundit
Comments
Post a Comment