8 Replies Latest reply: Mar 16, 2016 8:22 AM by Edgar Lensing RSS

    How to get the name of Rank 1 candidate?

    Edgar Lensing

      I use a Rank function to determine which merchant has the cheapest price for a specific product.

       

      I am able to have merchants as dimension and use Rank inside of an Aggr to count how much product a merchant has on Rank 1, 2, 3 ... etc.

       

      But now I need something different.

       

      I have the products as dimension in a table. And I want to create a column which gives me that merchant which is on Rank 1.

       

      I thought about using this:

       

      If ( aggr ( rank ( -min(price),1,1), product_id, merchant) , merchant)

      but this doesn't work as intended.

      neither does:

       

      Only ( {pseudo-code: where rank = 1} merchant)

       

      I have no clue how to achieve this.