3 Replies Latest reply: Aug 30, 2013 1:03 PM by Rob Wright RSS

    Returning the Max values of an existing expression

      Hello QV Community, I hope you can offer some help.

       

      I have an existing expression that returns a set of values for group of user responses from a survey.

       

      if(Response_Level_2B='Office',(sum ({$<Source_Key={2},Response_Level_2={'Office'}>}TOTAL<User_Profile_ID_SourceDB> Ans_Percent)/sum ({$<Source_Key={2}>}TOTAL<User_Profile_ID_SourceDB> Ans_Percent)/1)*sum ({$<Source_Key={3}>}Ans_Percent)/sum ({$<Source_Key={3}>}TOTAL<User_Profile_ID_SourceDB> Ans_Percent),if(Source_Key=2,sum ({$<Source_Key={2}>}Ans_Percent)/sum ({$<Source_Key={2}>} TOTAL<User_Profile_ID_SourceDB> Ans_Percent),0))

       

      This returns the following information

       

      User_Profile_ID_SourceDBResponse_Level_4Expression
      9652Room10%
      9652Out of Office13%
      9652Open Space23%
      9652Home24%
      9652Desk30%
      9692Open Space3%
      9692Room5%
      9692Home18%
      9692Desk33%
      9692Out of Office41%
      9713Room10%
      9713Open Space13%
      9713Out of Office21%
      9713Desk23%
      9713Home33%
      9763Home1%
      9763Open Space23%
      9763Room23%
      9763Desk53%
      9764Home12%
      9764Open Space17%
      9764Room19%
      9764Out of Office22%
      9764Desk31%
      9765Out of Office2%
      9765Home2%
      9765Open Space5%
      9765Room5%
      9765Desk86%

       

       

      I would like to be able to wrap a function around this expression that will return the highest response for each of the user responses so I will have the following information.

       

      User_Profile_ID_SourceDBResponse_Level_4Expression
      9652Desk30%
      9692Out of Office41%
      9713Home33%
      9763Desk53%
      9764Desk31%
      9765Desk86%

       

      Thanks

      Rob