Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use firstsortedvalue in a dimension

Hi all, this is my first post.

Need help trying to limit a dimension. I have created a chart and limit the chart to only show sales people in the top volume region.

I can find my top region by using =FirstSortedValue( region , -aggr( count(ordernumber), region ) )


But i don't know how to limit this to only show sales people in the top region. any help would be appreciated.

18 Replies
vishsaggi
Champion III
Champion III

Just close the bracket for Max() function. Its just a typo.

Aggr(If(Count(ordernumber) = Max(TOTAL <region> Aggr(Count(ordernumber), region)), SalesPerson), region, SalesPerson)

Anonymous
Not applicable
Author

thanks Vishwarath. the equation works but its not displaying the correct chart.

let me explain the background. We have multiple states broken down into multiple regions with multiple salespeople in each region.

Based on the filters (state, month), my chart needs to dynamically always show the top region with all of the sales people in that region and how many orders they completed.

vishsaggi
Champion III
Champion III

Share your sample qvw file where you having issues with.

sunny_talwar

I agree with vishsaggi‌, it might help to see what you have in order to trouble shoot it... a sample qvw or even raw data might help in figuring out what you are after....

Anonymous
Not applicable
Author

      Hi guys, thank you so much for your patience.

This is the table it would pull from and the chart that it should look like.

dtr.PNGchart.PNG

sunny_talwar

Try this

Dimension

SalesPerson

Expression

=Count({<Region = {"=Rank(Count(OrderID)) = 1"}>}OrderID)

Capture.JPG

Anonymous
Not applicable
Author

Thank you so much Sunny and team. That did the job!

sunny_talwar

Awesome , I am glad we finally managed to get it resolved

fabdulazeez
Partner - Creator III
Partner - Creator III

Its fine. I should have added more explanation so you could derive at the answer