cancel
Showing results for 
Search instead for 
Did you mean: 

Showing Total sales amount for the customers

Former Member
0 Kudos

Hi,

I have another simple question that I cannot get it done correctly

My data is having customer types and their sales values. Customers types are 'Individual customers', 'Corporate customers' , 'agents customers', 'Frequent customers'. Each type has at least 100 hundred customers.

All what I am trying to show is

1. Sum of Sales value for all the customers except  'Agent customers'

2. Sum of sales value for  Frequent customers

3. Sum of sales value of each customer type / total customers

I tried to group by the customers and their Sales. However, I do not know how to omit the 'Agent Customers' only or showing just one type of customer's sales value

i tried following code in the formula, but it just showing only one customer sales valus

numbervar i=0;

if {BAQReportResult.Customer.GroupCode}<>'AgentCust' then
WhileReadingRecords;
i:=i+{BAQReportResult.InvcHead.InvoiceAmt}

Please help me on this

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Rajeeshun,

Although, this can be done using one single formula, here's a simpler way to do this:

1) Group on Customer Type

2) Create a running total with the following options:

  • Field to Summarize : Add the Sales field. I guess it is {BAQReportResult.InvcHead.InvoiceAmt}?

  • Under 'Evaluate' click on the formula button and use this formula:

          {BAQReportResult.Customer.GroupCode} <> 'AgentCust'

  • Reset should be set to 'Never'

3) Place this Running Total on the details section and the Report Footer as well. This will give you the sum of sales for all customers except 'AgentCust'

4) Create another running total to find the sum of 'Frequent Customers'. The options under Running total should be as follows:

  • Field to Summarize : Add the Sales field. I guess it is {BAQReportResult.InvcHead.InvoiceAmt}?

  • Under 'Evaluate' click on the formula button and use this formula:

          {BAQReportResult.Customer.GroupCode} = 'Frequent Customer'


  • Reset should be set to 'Never'

5) Again, place this on the details section and the Report Footer

6) To find the sum of all customers just create a summary.

Go to Insert > Summary > Under Field to Summary choose {BAQReportResult.InvcHead.InvoiceAmt}.

Under 'Calculate this Summary' choose 'sum' and choose Grand Total (Report Footer) as the location.

Let me know how this goes!

-Abhilash

Former Member
0 Kudos

Excellent !!

Thank you  very much for the reply !! It worked well !!

I would like to present this statistics in a chart. Since these values are coming from formulas (running totals), I am not sure how to add them in the chart. Is there any way that Crystal report allows charts from the formula results?

abhilash_kumar
Active Contributor
0 Kudos

Well, running totals can be used in Charts, however print time formulas cannot.

The method I suggested is entirely based on Running totals so you should be able to created a chart off it.

Hope this helps!

And, please do not forget to make the thread as 'Answered'.

-Abhilash

Answers (0)