×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Cannot summarize or add a shared number to a graph

Cannot summarize or add a shared number to a graph

Cannot summarize or add a shared number to a graph

(OP)
Hello all,

I have a problem with a shared number from a subreport (empl_work_hours)

Cannot be summarized so we have create a shared number var "total" which is increased by adding the value every time to have this

The problem is that we need this value to put it in a graph

Is there a way or a different way to do that?

You can find the report attached

Thank you

RE: Cannot summarize or add a shared number to a graph

Try searching the BO forums using “Charting on print-time formulas” as keywords. There is a white paper on this topic on the SAP Business Objects website that these posts will be referencing. It is complex, but can be done. Of course, it would be simpler if you could eliminate the need for a subreport.

-LB

RE: Cannot summarize or add a shared number to a graph

(OP)
Sorry, but i cannot understand which part of this document can fit to this specific need

I have already the data needed but seems impossible to put them on one chart (in the main or in the subreport)

RE: Cannot summarize or add a shared number to a graph

The Charting on Print-time white paper is focused specifically on how to chart on formulas that contain print-time variables. Did you try to work through it? It is somewhat complex to do and there are tricks to it. Please explain what you tried.

Also, you could potentially get around all of this by eliminating the subreport. Could you have linked to the tables that would give you the employee work hours? You could also have used a conditional formula instead of a running total for your calculation in the subreport and then just inserted a summary on it. As a general principle, you could also make your report design easier to follow by eliminating all of the nested formulas, which make it hard to track back to what you are really doing.

-LB

RE: Cannot summarize or add a shared number to a graph

(OP)
Hello,

I have attached a zipped file with the report without the charting print time add and with it

the problem is that without i have no values on employees_hours formula even if there are, and with i get the error attached (the array dimension must be between 1 and 1000) so i cannot even see if there are results appeared with this way

I have also tried to created a formula instead of running total (hours) in the subreport but cannot be summarized or inserted to chart in the main report also

RE: Cannot summarize or add a shared number to a graph

I can't troubleshoot this easily without seeing the actual report saved with data.

You do not need a running total and it will only complicate matters. First make a formula {@null} by creating a new formula and then saving it without entering anything. Then create a second formula:

//{@cntreedtype}:
if {EMPLOYEE_DAY.REED_TYPE}=4 then 1 else
tonumber({@null})

You can either insert a sum (not count) on this formula at the group level, or you can create a formula:

sum({@cntreedtype},{Employee.REEM_Code})

Some pointers:

In the employee group footer, you should have two formulas for use in the chart:

//{@onchangeof}:
whileprintingrecords;
shared stringvar onchgof;
shared stringvar onchgof := onchgof + totext({Employee.REEM_Code},0,"")+ "^";

//{@showvalue}:
shared numbervar empl_work_days;
shared numbervar empl_work_hours := empl_work_days*{EMPLOYEE.REEM_AVAILABLE_HOURS};
shared stringvar showval;
showval := showval + totext(empl_work_hours,2,"") + "^"; //2 for 2 decimals or 0 for none; "" for no comma

The chart must be in its own subreport in the report footer (Add the employee table as the datasource). The sub should be linked on the main report formula {@onchangeof} and the selection formula within the sub should be:

totext({Employee.REEM_Code},0,"") in split({?Pm-@onchgof},"^")

Insert a group on {Employee.REEM_Code}.

Next create a formula within the sub:

//{@showval:
whileprintingrecords;
shared stringvar showval;
tonumber(split(showval,"^")[groupnumber]);

Insert the chart in the subreport report footer.
Add {Employee.REEM_Code} to the "on change of" box.
Add {@showval} to the show value box.

Do not leave the chart expert before finishing this. There is a trick to this, as formulas in the report list of the chart expert will disappear after the report is run, if I remember correctly.

If you need more assistance with this, please send the report saved with data.

-LB

RE: Cannot summarize or add a shared number to a graph

(OP)
Thank you very much

until now the only error that i get is on totext({Employee.REEM_Code},0,"") (too many arguments)

I cannot see why, the syntax seems ok. Can you help me with this? When this is fixed i will be able to check if working

Thanks again

RE: Cannot summarize or add a shared number to a graph

If the code is already a string, then use the code field directly without the to text and related arguments.

-LB

RE: Cannot summarize or add a shared number to a graph

(OP)
on the showvalue formula line
tonumber(split(showval,"^")[groupnumber]);
of the subreport

we get an error "the subscript must be between 1 and the size of the array"

RE: Cannot summarize or add a shared number to a graph

There is a limit of 1000 for an array. How many employees are there?

-LB

RE: Cannot summarize or add a shared number to a graph

(OP)
261 employees, the problem maybe is about the lines on other table (employee_day or vcr_employee_feedback) where the employee code appeared many times

RE: Cannot summarize or add a shared number to a graph

If you have a group on employee, then the array should only include 261 members. Please send your report saved with changes you have made so far. I can’t look at it until late this afternoon though.

Also make sure you have removed old formulas from the report layout that contain accumulating variables and that you are no longer using to make the chart. You don’t want variables accumulating in two different formulas.

-LB

RE: Cannot summarize or add a shared number to a graph

This report doesn't tell me much. You have added an outer group for category, which affects everything. Would you be charting separately for each category? (Placing the chart in the category group footer?) If so, you would have to have reset formulas in the category group header (in a group_a section, with the calendar report in the group_b section.

-LB

RE: Cannot summarize or add a shared number to a graph

PS. A question and two comments.

Question--instead of charting by employee, do you mean to chart by category???

You can get the group 2a header to not show by doing two things:
1) in the main report, go to format->subreport and check "suppress blank subreport"
2) in the section expert->group header 2a, check "suppress blank section".

-LB

RE: Cannot summarize or add a shared number to a graph

What two total numbers? Also, please identify exactly what you want to end up with. Starting out simple only means a bunch of changes later on.

-LB

RE: Cannot summarize or add a shared number to a graph

(OP)
@total_print and/or @avg_percent

Finally we need a chart with two bars comparing the total hours worked and the available hours of the employees

RE: Cannot summarize or add a shared number to a graph

Sorry, I can’t help you further. You cannot do the chart piecemeal. It’s tricky as it is with only one summary and by it’s nature, you have to set it up in all at once or it won’t work. You are talking two summaries and potentially at a group level, and i still don’t have a clear picture of what that would look like. I think you have made this report more complex than it needs to be by using the employee subreport in the first place (which you haven’t justified)—you might be able to avoid using variables at all, in which case charting would be simplified. I could do this chart for you, but I can’t without access to the data source, and I am unwilling to continue walking you down this path that keeps getting longer. I also don’t see any evidence that you have incorporated any of my suggestions.

-LB

RE: Cannot summarize or add a shared number to a graph

(OP)
Thank you very much for the assistance till now.

I have a report with your first suggestion but is unable to save it with data as i took the error "the subscript must be between 1 and the size of the array"

RE: Cannot summarize or add a shared number to a graph

(OP)
I am trying to setup all to table to one report but i have wrong summaries

For example i need to have the summary of actual hours of an employee but when i include the employee_day table which has 365 lines of the specific employee (line per day) the result is x365

I have include the report to check what i mean. As you can see we have a total summary 320 thousand hours instead of 5 thousand for hours worked which is the normal value

RE: Cannot summarize or add a shared number to a graph

(OP)
I have finally have the results without subreports with running totals

But it is not possible to have this values as a percentance or insert the "percent" formula in the chart

You think that is there a way to have this result? Create familiar formulas instead of running total maybe? is that logic possible?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close