Available fields when Charting

Hi Crystal Experts

I have a crystal report which works fine in reporting the data from the dataset
The data is grouped by EmployeeDepartment and Weeks
where we can see the salaries per week within each parent department

However I got a unusual request from my boss to report on a statistic.
The way we calculate this statistic is

value  = Sum(IndividualSalary)/DistinctNumberOfEmployees

I have created a field called DistinctNumberOfEmployees
I have 'Distinct Number of Employees' as a running total and it works fine
I have placed this on the group footer for Weeks

I then created a  formula field called AverageSalaryPerWeek
which uses the formula above:
Sum(salarydatabase.IndividualSalary)/DistinctNumberOfEmployees

This works fine in the data that is spat out

Problem is with the charting
When I proceed to chart a line graph, the field AverageSalaryPerWeek does not show in the available fields to put for the Y AXIS

If I change the formula by taking out the SUM() function it does come up

This is a weird problem and I would appreciate any assistance with this
I am getting very very desperate and am hoping it can be done...or else....
Thankyou very much for your time



Answer this question

Available fields when Charting

  • PhillipR

    Hello,

    This is complicated because of the number of passes that Crystal Reports uses to calculate these different elements. 

    I know that there are advanced ways to work around this and one possible solution can be found in a sample report:

    http://support.businessobjects.com/communityCS/FilesAndUpdates/cr_graphing_samples.zip.asp

    and the report is: graph on % change.rpt

    You will need to read the text in the report as it describes what this report does and also the additional file that you may need to download to make it work.

    Two other whitepapers that may be of interest to you include:

    http://support.businessobjects.com/communityCS/TechnicalPapers/cr9_charting_print_time_formulas.pdf.asp

    and

    http://support.businessobjects.com/communityCS/TechnicalPapers/cr9_evaluationtimes.pdf.asp

    Keith - Business Objects

  • Johan Nordberg

    Thankyou very much Keith
    I will give it a go

  • ggirish

    Hi Keith

    Major problems
    I have read all the literature but seem to be missing something

    This is what Ive got

    1. Main report shows sales figures per person
        The report is grouped by department and then week
       At the end of week I use a running total called DistinctNumberEmployees
       This gives me the number of distinct employees in that week

       At the Week Group footer I then insert a new formula called AverageSales
    AverageSales:=TotalSales/DistinctNumberEmployees

    2. After reading the cr9_charting_printtime_formulas pdf, I create a subreport
       I insert the table CustomerSales but I am forced to enter at least one field into the subreport...otherwise i cant click on Finish button

    3. I then edit the reports sublinks-
    My ChangeOfField is WeekNo
    My ShowValueField is AverageSales

    I untick both 'Select Data in subreport based on field'

    4. I move onto my subreport and NOTHING. I dont see any of the fields in the 'Available fields' list when i try to add a graph

    Please please help me......I appreciate your help

  • Available fields when Charting