Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
kvr9
Creator
Creator

Sorting query

Scenario :

There are 5 companies A,B,C,D,E with their amount .

Load inline

Company      Amount

    A  ,50

B,10

C,30

D,15

E,60

I want to sort the companies keep one company (C) as 1st column which is fixed and then followed by other companies sorted based on values .

The desired output should be as below in descending order on bar chart  :

C,E,A,D,B

11 Replies
prma7799
Master III
Master III

Like this we can do...

mdmukramali
Specialist III
Specialist III

Dear,

You can use the below Expression in the sort:

pick(1+match(Company,'C'),rank(sum(Amount)),0)

Sort.PNG

kvr9
Creator
Creator
Author

Thank you for your response.

I tired above options but the sort is not  working as desired ,neither it is sorting based on Amount nor descending order.

below is the snapshot of my result.

Request you to help in sorting the bar charttestsort.PNG

mdmukramali
Specialist III
Specialist III

Hi,

It seems you are using 2 Dimensions and 1 Expression in the Chart.

I also tried and it's working fine.

can you share your sort tab properties screen shot?

sort1.PNG

kvr9
Creator
Creator
Author

It works perfectly.

Many thanks Mohammed.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi Vijaya Reddy

Please always close the thread (by Marking Correct/Helpful answer), once any of the response solves your query.

-Celambarasan

kvr9
Creator
Creator
Author

Hi ,

I have an additional requirement ,I am using two expression so used a group function in my chart.

The sort function is reflecting correctly to only one expression and not to the 2nd one.

How can  I resolve this issue.

Thank In advance.

mdmukramali
Specialist III
Specialist III

Hi,

Can you upload sample file data.

kvr9
Creator
Creator
Author

Hi Please find the sample data and qvw.

Can you also help in calculating the percentage of sales by product