what is the use of filter in google analytics?

I'm not really understanding your question. Sometimes you want to just see trends or behavior on a specific segment of your audience. For example, I want to see how many logged in users I get, and how their behaviors compare ot all users who visit the site. Filters let you retrieve all of Google Analytics data but just for a segment of your audience.

You can also use filters to filter out data from your own networks. This will prevent internal use of your site/app by
employees/testers from influencing statistics.