2 Replies Latest reply: Jun 14, 2013 5:39 PM by Puneet Lakhanpal RSS

    How to get a prescriber with maximum value (FirstSortedValue), independent of selections

      Hi Guys,

       

      I created a sample qvw (attached) in which I am trying to get the prescriber with maximum TRx. I am using FirstSortedValue function for satisfying the requirement.

       

      However, I want this text to be independent of the prescriber selection. For instance, if P1, P2, P3 and P4 exist in the data and P4 is the prescriber with max TRx, how can I keep P4 as the top prescriber even when P1 and P2 are selected ?

       

      PrescriberTRx
      P1200
      P2300
      P3400
      P4500

       

      The top prescriber is obtained with expression

       

      =FirstSortedValue(Prescriber, -Aggr(Sum(TRx), Prescriber))

       

      Thanks,

      Puneet.