Avatar of Marcos27
Flag for United States of America asked on

How to Make a Bar Graph in Descending order (based on my Running Total Field)

Hello Experts -

I'm trying to graph some simple data. I have 20 recordIDs, and each record has a color field (blue, red, green, purple). I want to group by color in my Crystal Report (X), so that I have 5 blue, 3 Red, 8 Green, and 4 Purple. If I graph # of records on the Y axis, color group on the X, how can I have the graph display the largest group first - so it would show Green, then Blue, Purple and Red, like a decending staircase.

Crystal ReportsDatabasesMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon
Mike McCracken

I don't know.  Can you upload the report with some data so I can try a couple of ideas?


It's actually a much more complicated report linked to secure tables here at work, so I don't have anything to upload. I simplified the the question just to illustrate the basic idea of what I'm trying to do. It doesn't seem like I can order by the Running Total field (# of events per group). Maybe I have to create a stored procedure and group prior to pulling into Crystal.??

If nobody has an easy solution, I can find a work around. Thanks.
Mike McCracken

You can't order by the running total because it is calculate after the grouping and sorting is done.

Can you use a SUMMARY (count) for the running total?

Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes

I'm not sure what you mean. I have a chart that shows color groups (on change of Color) - along the X axis. The Y axis is RecordID - which is set as a Summary (count). I can set an order on Color field, but that order can only be ascending, descending, specified or original. None of those orders order the chart from high to low.
Mike McCracken

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Well that was easy! In the Chart Expert you can just select the group --> TopN (Sort Expert), and then sort all by count of the records.

Brilliant! Thank you :)
Mike McCracken

Glad you found that.  I don't use charts very much so I didn't know it was there.

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.