creating a stacked bar chart with raw numbers in Crystal?

How do you create a stacked bar chart in Crystal report when you have the raw number you want to graph? < For example

Goal = 5 , Actual = 3, FY2018

Goal = 6, Actual = 7, FY2017

Goal = 8, Actual = 3, FY2016

Goal = 5, Actual = 5, FY2015

under Data

On change of : Fiscal Year and Show values : Count of Goal Count of Actual

I am not able to change to max or actual #, it only gives me a distinct cnt or a count. I am trying to create a stacked bar that shows progress against goals. Something like this.
jacobson sonnyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Does CR see the Goal and Actual fields as numbers?  If it sees them as another type, like string, then you only get the count and distinct count options in a chart.  If that's the problem, you could try creating formulas that use ToNumber or Val to convert those fields to numbers and then use those formulas in the chart, instead of the fields.

 If CR does see those fields as numbers, then I don't know why you're not getting the other options (Sum, etc.) in the chart.

jacobson sonnyAuthor Commented:
Thank you so much James. It looks like that was it. I had the tochar on the goal and actual. After removing, i see the options to pick sum, max, min under show value summary option.  I playing around with it. The max work for actual but it shows a sum on goal. I get 3 shown as actual but goal is 8. It looks like it is summing.
ex: on the pic, 5 is the progress but the goal is 25.  34 is the progress and goal 25 but it summed it. I was able to get it by having absolute value but the bar is still showing the sum
Sorry to come back to you again.
If I follow what you're saying, that's normal.  In a stacked bar chart, the bars/values are actually "stacked" on top of each other, so the total bar height is the combination of all of those bars.  It sounds like you were basically looking for goal and actual to be two separate bars, with actual superimposed over goal.

 If I'm right about that, you could just use a regular bar chart, where you should get actual and goal side by side.

 Another option might be to use a stacked bar chart, but replace goal with a formula:

{Goal field} - {Actual field}

 Then the goal segment of the bar will be the difference between the two, and the total bar height will be the goal amount (assuming that Goal >= Actual).  However, if actual can ever exceed the goal (as it seems to in one of your examples), then that probably isn't a good solution, because you'd get a negative value for the goal, resulting in a negative goal bar (shown below the bar for actual).


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jacobson sonnyAuthor Commented:
Thank you James. So i ended up using just regular bar instead of stacked bar. I tried the difference but again like you said with people surpassing their goals, we end up with the bar below the X axis.

It looks good but now, i have to figure out how to put the progress on top of the goals. I did put both on show values but only goal are showing (whatever you put on top)

i should try cross tab then chart it
I'm not sure what you mean by "put the progress on top of the goals".  It would probably be simplest if you could post your report (.rpt) file, so that I can see how you have the chart set up.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.