try wrapping the entire select inside of parenthesis. Because when Tableau executes custom SQL, it wraps it in it's own select which I believe is something like this. If you want to confirm, you can look in the desktop logs.
select TableauSQL.* from
(select Table_1.col_1, table_1.col_2,
case when table_1.col_3 = 'AA' and table_1.col_4=x.Current_year1 then 'Y'
when table_1.col_3 = 'AA' and table_1.col_4=x.current_year1 and col_4 is null then 'Y'
else col_3 end as Flag
From Table_1 , (select value as Current_year1 from Table_2 where parameter = 'Current_year') x)) TableauSQL