Hello Jyothi,
What is the Source of your HANA (e.g. ECC etc)?
I would recommend to create a filter object on that date object that you can drag in the query to limit your data for just 2 years.
Something like below based on the
Year(Table.DateObject) =Year(CURRENT_DATE)
OR
Year(Table.DateObject) =Year(CURRENT_DATE)-1
Also I would recommend to create a Calculated Column on HANA itself that you can make use of while creating filter.
Here is the code to get that
component(date, int)
Where Date is the date field and you need to give 1 for second parameter to extract year
Regards
Niraj