Skip to main content
Solved

Sort by metric result highest number

  • October 26, 2023
  • 4 replies
  • 233 views

Forum|alt.badge.img+8

Hello!

Can someone please help how I can sort by highest number? I would like to sort the vendor name by 2023 Total amount. 

Thank you!

 

 

Best answer by Benoit

What is the current formula you have?

You should be able to use the rank function

 

Rank(Vendor_OP.’2023 Total (A+F)’) should work

If zeros are listed as third position, it means maybe you have 2 negative values.

To verify, maybe you could go to your metric and use the sorting to see if it renders correctly?

4 replies

Benoit
Community Manager
Forum|alt.badge.img+15
  • Community Manager
  • October 27, 2023

Hi Yaejis,

Unfortunately the sorting feature can not be used on aggregators.

It works only on dimension properties or metric values.

 

A good workaround is:

  • create a new integer property in your Vendor_OP dimension called something like “Rank 2023” where with a formula you rank your Vendors based on your metric 2023 total amount
  • go back on your metric and add a sort on Vendor_OP using your new ranking property

 

 

Hope this helps.

 

Best,


Forum|alt.badge.img+8
  • Author
  • Master Author
  • October 27, 2023

Thanks for suggesting workaround option! 

 

I created two properties -  1)  to get 2023 total amount (like a stage) and 2) for final output to Rank based on #1. 

Can you please help on the Rank formula? I tried but seems the result doesn’t look right.

 

Thank you!

 

 


Benoit
Community Manager
Forum|alt.badge.img+15
  • Community Manager
  • Answer
  • October 27, 2023

What is the current formula you have?

You should be able to use the rank function

 

Rank(Vendor_OP.’2023 Total (A+F)’) should work

If zeros are listed as third position, it means maybe you have 2 negative values.

To verify, maybe you could go to your metric and use the sorting to see if it renders correctly?


Forum|alt.badge.img+8
  • Author
  • Master Author
  • October 30, 2023

Ah, formula is simpler than expected. Thank you!