Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
Not applicable
Author

Hello, I received an answer to this question and wanted to make sure that the right person got the credit.

So, thank you Daniel Rozental - with a minor adjustment this worked for the problem above.

if( yourexpression = max(total <User_Profile_ID_SourceDB, Ans_Percent>

aggr( yourexpression, User_Profile_ID_SourceDB, Response_Level_4)),

yourexpression)

Cheers

Rob

View solution in original post

3 Replies
Gysbert_Wassenaar

Try using the Dimension Limits option. Open the properties window of your chart and go to the Dimension Limits tab. If that tab doesn't exist change the chart type to Straight Table. On the Dimension Limits tab click on the Response_Level_4 dimension. Then select Show only Largest 1 values. Also make sure the Show Others option is disabled.

See the below image for an example. The left table shows the sum of sales for every Product-SalesPerson combination, the table on the right only the top values per product:

comm90028.png


talk is cheap, supply exceeds demand
Not applicable
Author

Hi, yes I tried that which works for a similar table I have but for this specific expression it doesn't return the result.  That's why I'm looking for the wrap around.

Not applicable
Author

Hello, I received an answer to this question and wanted to make sure that the right person got the credit.

So, thank you Daniel Rozental - with a minor adjustment this worked for the problem above.

if( yourexpression = max(total <User_Profile_ID_SourceDB, Ans_Percent>

aggr( yourexpression, User_Profile_ID_SourceDB, Response_Level_4)),

yourexpression)

Cheers

Rob