Skip to Content
0
Former Member
Nov 08, 2012 at 04:52 PM

Running total for Shared variable

1630 Views

Dear all,

I passed a shared variable from a subreport to my main report and it worked perfectly. I am however, having difficulty creating a running total for the column with the shared variable since i cannot view it(shared variable) in the running total available fields. .The sub report where the shared variable originates generates values from a single project and my main report generates similar values from multiple projects grouped by the project number. The link between both reports is the project number.

Below is a simplified version of my report.

Proj. No. Income Expenditure Cumulated Expens.(Shared variable) P1 100 50 70 P2 100 50 70 P3 100 50 50

All project transactions are recorded in a project journal on a transactional basis so the main report groups all income and expenditure transactions by project number(Proj. No.) . The values in the last column (cumulated exp.) are derived from a subreport via a shared variable (CumExp). The figures in the report are derived from the project journal.

Main report parameters are: Start date and End Date - Meant to filter out the transactions by period.

Sub report parameter = Project Number (Proj. No.)

based on the above information, I would be extremely grateful if any of you could assist me in the following questions:

1) I would need to sum up all the values of the last column (Cumulated Expens.) but cannot find a way to since this formula isn't visible from the running totals field. Is it possible to sum up the values for all data records from a shared variable i.e. the Cumulated Expens. column?

2) Furthermore, I have a second section (GFb) in the main report that is identical to the table illustrated above. I created a flag/parameter (Active/inactive project) which determines which section will be suppressed. Each of these two sections (GFa and GFb) also have individual total sections (RFa and RFb) to sum up the project figures. The total sections RFa and RFb are also suppressed depending on which flag is selected. My flags are as follows:

Active projects = {criteria}

inactive Projects = {criteria}

I defined the criteria for an active/inactive project in the respective GF (a) nd b)) sections when defining when to suppress the section. Tricky part is, part of the definition of whether a project is active/inactive includes the shared variable (cumulated expenses) illustrated in the diagram above. I would therefore need to be able to define when the running total should be evaluated i.e. when the project is active or inactive.

Any help in any of the two questions would be highly appreciated.

best regards,

MK

PS: I'm more of an advanced beginner with crystal.