2 Replies Latest reply: Mar 9, 2016 4:51 AM by Edgar Lensing RSS

    Plz help to solve this 'Nested aggr' (Count if)

    Edgar Lensing

      Hi,

      I have several merchants selling products.

       

      I want to see how one specific merchant performs against the other offers.

       

      I want to show this as:

      32 of his products are cheaper then the (other) cheapest merchant

      5 products are equal with the cheapest

      41 products are more expensive then the cheapest price.

       

      Thus I need the min(price) of the merchant, which is in the focus.

      And the min(price) of the other merchants excluding the "focus-merchant".

       

      I have those two minimums as:

      min(ALL <product_id> { $ <calc_merchant = {"OWN_CLIENT_DATA_FLAG"}>} price)

      min(ALL <product_id> { $ <calc_merchant -= {"OWN_CLIENT_DATA_FLAG"}>} price)

       

      now i need to count:

      count ( if ( minFocusMerch < minOther, 1 count for cheapest, 1 for more exp)

       

      First problem:

      How to get rid off the nested aggr.

       

      Second problem:

      How could I use the 3 conditions as 2. dimension for a bar-chart