3 Replies Latest reply: Aug 9, 2012 1:41 AM by Liron Baram RSS

    Aggr on Expression

      Hello, Developers.

       

      I need some help with Aggr on Expression.

      I'm trying to get counts from multiple columns and group them by the max of the count.

      Here is what I'm trying to do

       

      Order #Item 1Item 2Item 3Item 4
      1Box Blue
      1Box BlueBox Red
      2Cup BlueCup RedCup Green
      2Cup Blue

       

      Then the count of each order will look like this

       

      OrderCount
      11
      12
      23
      21

       

      Now.. I want to make it like

       

       

      OrderCount
      12
      23

       

      So I used in Straight Table:

       

       

       

       

      AGGR(MAX(
      COUNT(DISTINCT Item1) + COUNT(DISTINCT Item2) + COUNT(DISTINCT Item3) +
      COUNT(DISTINCT Item4))
      , Order_ID

      )

       

      1) Am I using right function and right syntax (i know at least 2nd part is not right)

      2) Can you help me to correct this?

       

      Thanks!