I always found confusing both concepts! Which one do you think is more important? I give an example: The journal of "Theoretical and Applied Climatology" has an impact factor of 2.88, but it's a Q2 journal according to Scimago (https://www.scimagojr.com/journalsearch.php?q=14171&tip=sid&clean=0). In the other hand, "Journal of Integrative Agriculture" has an impact factor of 1.98 but it's a Q1 journal (https://www.scimagojr.com/journalsearch.php?q=21100203903&tip=sid&clean=0).
So, if we should rank both journals, which metrics should we choose? I am curious to know!