Gratuity is not 4.7% on basic salary, and it should not be deducted from your salary. May be your company shows that as CTC. After completion of 5 years in your company, while you retire, you have to get the amount calculated as follows.
Basic salary at the time of retirement / 26 days x 15 x No. of years you served.
Which means you will be getting 15 days basic salary for every year you served. For Eg: your basic at the time of resignation is Rs. 10,000/-. SO, per day basic will be Rs. 384/- x 15 days = Rs.5769/- x no of years you served = gratuity amount