6 Replies Latest reply: Jan 12, 2018 9:16 AM by Peter Derrington

# Sort by Calculated Expression?

Hi,

Hoping for some guidance.....

I have a set of bar charts that each show a stacked bar that contains a set of defined expressions.

eg: Count({<[4th Place]={'All Things'}>}([4thThere]))

What I would like to happen is for when I select a defined element (eg Month) that it alters the order of the chart so that the largest numbered section is at the bottom. At the moment it retains everything in the order that is shown in the 'Expressions' Tab.

Any ideas?

• ###### Re: Sort by Calculated Expression?

Maybe you can create a fake dimension with Valuelist() and have only one expression.

So you can use that expression under Sort tab

• ###### Re: Sort by Calculated Expression?

Sorry, I'm not quite sure how I would do that.

Could you explain a little bit for me?

• ###### Re: Sort by Calculated Expression?

Create one expression like

If(Valuelist('Exp1','Exp2') = 'Exp1',

Sum(Expression1),

If(Valuelist('Exp1','Exp2') = 'Exp2',

Sum(Expression2)

))

• ###### Re: Sort by Calculated Expression?

Sorry, I'm obviously having a slow day.

I don't understand how that would work.

• ###### Re: Sort by Calculated Expression?

Would you be able to share a sample to try this out?

• ###### Re: Sort by Calculated Expression?

Attached is a small example of the data.

1st Graph:

Used Dimensions: 1stPlace

Expression 'General' - Count({<[1st Place Speciality]={'General'}>}([1stPlace]))

2nd Graph:

Used Dimensions: 2ndPlace

Expression 'General' - Count({<[2nd Place Speciality]={'General'}>}([2ndPlace]))

and then theres obviously lots of other expressions showing the other elements.