'Generate ranking for each row

I'm developing a list of import processes that has two databases: maritime and aerial. I created a database (Processes) that joins these two bases. Each process has a cnpj that is the identifier of a company that made the import. The idea is to have a column that identifies the largest consignee of each importer.

Ranking

I have already created a general ranking. But the idea is to filter each consignee's cnpj and search for its biggest freight forwarder.

Database aerial:

enter image description here Database Maritime:

enter image description here Database processes:

enter image description here Database consignee:

enter image description here Database Agent:

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source