Jump to content
We've recently updated our Privacy Statement, available here. ×

Calculating percentage over time within trellis


Chris R 2

Recommended Posts

Dear all

I have a simple boxplot that displays a unique count over time. Using the trellis I can then present this by 4 different categories, lets say apples, bananas, oranges and pears.

What I want to show however is the percentage each fruit category accounts for within a selected time period and then present this as a seperate bar within each trellis.

E.g.

February 2019 there were: 10 apples, 15 bananas, 5 oranges and 5 pears.

March 2019 there were: 15 apples, 15 bananas, 0 oranges and 10 pears.

I want a seperate plot for apple, banana, orange and pear to show the percentage:

E.g. for Apple the plot will show February 28.6%, March 37.5%

etc

So farI can create 1 boxplot for apples with an expression like this - >

UniqueCount(If([Category]="Apple",[FruitID])) / UniqueCount([FruitID]) over (Intersect([Axis.X]))

My real data has 17 categories so I dont want to create 17 seperate boxplots with 17 seperate expressions so using an expression that works for trellis by category would be great.

Any help would be very much appreciated!

Link to comment
Share on other sites

  • 5 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...