counting fields based on group in crystal report - crystal-reports

hi all i wana ask a question about crystal reporting in vs 2008
lets say i have a report with these data
customer_ID Customer_Name Order_amoont Order_Date
(#group1 VipCustomer)
1 xyz 3 1/1/2010
2 abc 4 2/2/2010
5 sds 21 3/12/2009
(#Group2 NormalCustomer)
3 tyt 2 3/3/2010
4 ha 4 21/3/2009
i want only to display records where Order_Date year is in 2010 only so i went to the section expert and i added a condintion in suppress formula Year(order_Date)=2010 and i get the result ,,the question is how to count how many vip customers ordered in 2010 only and how many normal customer order in 2010 only ,,then i want the total number of both type of customers to be displayed to have a report like that::
customer_ID Customer_Name Order_amoont Order_Date
(#group1 VipCustomer)
1 xyz 3 1/1/2010
2 abc 4 2/2/2010
subtotal 2
(#Group2 NormalCustomer)
3 tyt 2 3/3/2010
subtotal 1
total 3

i know that answer ,and i will answer it
1-make a conditional formula field and add to it this condtion
if year(Order_Date)=2010 then 1
2-then add summary to the formula filed
--to get total place this summary in the report footer
--to get sub-total place this symmary in group footer
there is also another way to do it
by using running total field and it evaluate section us the formula year(Order_Date)=2010
then to get total place the running field in report footer
to get sub-total make a new running field the same as the 1st but in the reset section check on reset of change of group and place this field in group footer
thnx

Related

Crystal Crosstab - access summarized values

I am trying to access the summarized fields in a crosstab in order to determine which is the greatest value in a row.
My data displayed is as follows:
Jan Feb Mar Quarter
clerk 1 shoes 0 3 1 4
clerk 1 pants 5 10 10 25
What I need to display on the report is that the major item sold by Clerk 1 is pants.
I am table to do this on a monthly basis but not summary level. Any ideas?
Thanks, Holdfast
You need to insert Embeeded Summary at grand total level and write maximum or minimum formula to retrive, but one issue here is when you insert embeeded summary then you will get extra row at each level of the cross tab.
Note: This is possible in CR 2008 and I have tested in CR 2008

How to calculate the sum total of separated group field in Crystal Report

I am making a report in "SAP Crystal Reports" and I need to calculate the sum total of the group field. Report is grouped by user name, I made the "Running Total Fields" field and it calculates all of them as in example below:
UserName 1 2
3
1
-----------
6
UserName 2 1
2
-----------
9 <------- I need here 3
Does anyone know how to solve this?
Thanks in advance.
Two options:
edit the running total field and reset it after each group (it is now generating a total for all records).
use a summarized field - select the field in the details section and choose Insert | Summarized Field...
I would also suggest reading a book on the topic.

Crystal Reports : combine and sum two fields if another field is a duplicate

i have been having trouble for a while figuring this out. I am looking to combine the rows that have duplicate "materials" and in doing so sum up the quantities of each and the prices.
Material qty unit price
a 5 20.00
a 5 20.00
b 2 5.00
c 1 5.00
and to get it like
Material qty unit price
a 10 40.00
b 2 5.00
c 1 5.00
Ive looked and found similar questions but couldnt figure it out. sorry if its a repost.
Thanks
When you begin creating the report, one of the first options is grouping, followed by aggregates (sum, count etc.). Once you finish the report wizard, suppress the details and the group headers.
Create a Group based on your Material field and then insert a summary by right-clicking on your qty field -> Insert Summary.
If you can't (or don't want to) group, then you will have to create running totals to summarize your different materials.

crystal report summary

Data Table
pack_ID qty
1 3
1 4
1 9
2 10
3 1
3 3
I want to display the following in Crystal Report
pack_ID qty
1 16
2 10
3 4
How ?
Insert group on pack_id, insert field summary (sum(qty)) into group footer, hide details section.
simple to do in the sql:
SELECT pack_ID,SUM(qty) FROM Table GROUP BY pack_ID
There is one another way to implement this solution is that if you have less pack_id and need to show this details into particular section instead of dynamically to show the sum of each and every records. Below are the steps:
Create formula Qty_Count_Pack_1 which will store the number of quantity with pack_id 1. You need to create number of formula as per number of pack_id.
if ({command.Pack_Id}) = 1) THEN
{command.Qty}
else
0
Use Summary formula field to sum the Qty which will give the summary of qty for pack_Id 1.
Sum({#Qty_Count_Pack_1},{command.pack_ID})
There are 2 steps as:
Insert Group of pack_ID
Copy qty from detail block to Group of pack_ID the same line
so u can see result as u expect.

cyrtsal report how to hide records based on condition of a field like date

hi all i have a question about hiding records in crystal report
and i am using cyrstal report in vs 2008 ,i dont know its version as i am new in crystal reporting
lets say i have report like that
customer_Id customer_name OrderAmount Order_date
0 xyz 5 03/02/2010
1 abc 6 04/02/2010
3 dre 7 07/02/2009
4 kila 3 08/02/2009
i wana ask is there a pssibilty to hide the record if Order_Date year in 2009 and show only the records where Order_date year in 2010
to be like that :
customer_Id customer_name OrderAmount Order_date
0 xyz 5 03/02/2010
1 abc 6 04/02/2010
**note i do need the data of 2009 to make a bar chart for this year
thanks in advance
So the report itself will have a bar chart on to show 2009, but the list of records shouldn't show 2009?
Two options :
The first is a subreport.
The second is to use a suppression formula in the Details section that says "Year(Order_Date) = 2009".