How to make different filter tags in category template?

Hi, there!

So, I got let say 3 main categories, and inside each of them there are some subcategories. And inside my category template I have filter tags (filter by subcategory).

Well, what I can not understand is — how should I set up the links to filter tags, so subcategories change along with the main category? (If that is even possible)