Set different transparency according to the height of the entity

I add a cylinder to the base map, I want to set different transparency according to the height of the cylinder, the bottom of the cylinder transparency is low, the higher the height of the higher transparency, how to achieve this effect?