Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Topic: Creating Overall % and Graphs

Status
Not open for further replies.

fyoung10

IS-IT--Management
Sep 15, 2010
2
US
Hi I am new to Crystal Reports and need help.

I am trying to create a report that has multiple totals on it. Each total has a different criteria that i am counting. For Example We have plans within a system, and I want to know how many plans are in the system and print that total. Then on another line I want to know, how many of those plans are critical and print that total, on another line, how many of the critical plans have tested..etc. So each one (total) will have a different criteria. i was able to create the formulas to achieve all of the totals that I needed. The problem is when i try to put them all on the main report all the numbers change. Which lead me to believe that i can't put them all on the main report i have to create separate sub reports with the different totals i need.

My question is on the main report i have to have a summary of all of the numbers for instance I will need to know out of all of the critical plans in the system, what is the percentage that have tested? Well if i do the separate sub reports those numbers will be in two separate reports. Is there a way that I can have the system look at both of those numbers and create my percentage on the main report?

Also, I will need to be able to depict the overall totals on main report graphically.

Hopefully this can be done, and someone can help me. Also, if i was not clear or you didn't understand what i was writing please let me know.

Thanks for any help i can get
 
I would avoid using subreports for this, since you want to chart results. Can you explain why you used subreports in the first place? What tables are you accessing? You can create conditional formulas to get totals for various conditions without using subreports.

-LB
 
Thanks for responding! I never heard of conditional formulas before. I guess I will have to read up on that. I used subreports because when i would put all the formulas in the main report the number would be correct, but as soon as i add a new formula the previous number would change. Here are some examples of how i wrote the formula (note that it prob is a better way to do this)

1. I am trying to achive the total number of plans tested for the current year. They have to meet the following criteria: A) The meets requirments field must say yest, and B) The Date must be greater than 12/31/2009. With that this is what i did.

Formula 1:

{Supply.U_actualtestdate} > DateTime (2009, 12, 31, 00, 00, 00)

Formula 2:

{lv_PickFromList0_MEETS_REQ.value} = 'yes'

Formula 3:

if {@Formula 1} and {@Formula 2} = true then 1 else 0

So Formula 3 is the one I would do a SUM on and get the number I needed. I actually did this for all of the formulas i need. With that being said when I would go and add the second formula in (done the same way as above) the numbers in the report would change. They would not stay the same. As i continued to add the other formulas all the numbers became a mess and didn't make any sense. If you know of an easier way and the numbers won't change, this would be GREAT!

Thanks and if you need more info, let me know, but this is basically all i have so far. I did the same formula each time for the "conditions" i wanted.

Thanks again.

 
The issue probably begins with your table links. If you are using multiple tables, then when you reference a field from a previously unused table, it causes record inflation, thus changing your numbers. You should begin by ensuring your table links make sense, and then add the fields you will be summarizing to the detail section. Right click on one of the recurring fields and insert a count and a distinct count and then see if these numbers are what you expect to see.

Sort the records in a way that makes sense to you, and then observe any repeating patterns in the data. Then decide how to summarize the data. I would use conditional formulas, like:

if {Supply.U_actualtestdate} > DateTime (2009, 12, 31, 00, 00, 00) and
{lv_PickFromList0_MEETS_REQ.value} = 'yes' then 1

If this summing (not counting) this formula gives you an inflated result, there is a way you can adapt the formula, but first report back on the result you get, and also show some sample data as it displays in the detail section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top