2 Replies Latest reply: Sep 3, 2018 3:22 AM by Sergii Karandin RSS

    Using set analysis (?) to keep records only => than aggr (?) in chart

    Sergii Karandin

      Good day dear community,

      I came across the following task:

      Calculate sum(value) but only for those buyers, which have no less that 5 transactions.

      Let's say I have a model with these two tables:

      Trans:

      trans_idbuyer_idtrans_value
      1A10
      2A20
      3B30

       

      buyer_idbuyer_name
      AAlpha
      BBravo

       

      Then I visualize it in a bar chart:

      Dimension: buyer_name

      Measure: sum(trans_value)

       

      I've achieved the desired result with IF: if(count(trans_id)>=5, sum(trans_value))

      But wonder is there a more elegant/efficient way to do the same with set analysis?

      Would appreciate any help, thanks