Only hide duplicated fields in Crystal Reports - sql-server-2008-r2

I have a table in a SQL Server 2008 R2 database like this:
Num Total Item Item Value
--------------------------------------
1 5000 Cup 2000
1 5000 Brush 3000
2 2500 Kandy 2500
3 1000 Soap 750
3 1000 Rice 250
As you can see there is a duplication in the Num, Total columns, it must be like
Num Total Item Item Value
----------------------------------------
1 5000 Cup 2000
Brush 3000
2 2500 Kandy 2500
3 1000 Soap 750
Rice 250
I've tried to use SQL Group By clause, but that didn't work. I also tried to suppress when duplicated in Crystal Reports, but it removes the entire row
So any help?

In the Group Expert inside of Crystal Reports, group your report on the Num and Total fields.

I found it,
Removing the duplicated fields by suppressing them when they are equal to it's previous record
Num Field ==> Suppress ==> Add this
{Num} = previous({Num})
Total Field ==> Suppress ==> Add this
{Total} = previous({Total})

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

Crystal Reports - group total at begining of group

I have this report:
Question Group
----Question - [TOTAL]
--------Answer 1 (10)
--------Answer 2 (0)
--------Answer 3 (8)
--------Answer 4 (2)
----Total: 20
Total: 20 is calculated with running total field, and it can only be calculated after each question finishes.
What I want is to place this value at the beginning ([TOTAL]), so it can be used to calculate percentages (--------Answer 1 (50%)).
I tried with formulas, with no success.
I managed to change the SQL that feeds the report and then used a formula to do what I want
count({newfield},{group})

How to add a conditional grand total in Crystal Reports?

I have a group running total that needs to be sum up at the report footer. Since thats not possible with CR I had to end up having another running total that refreshes "Never". But now I need to calculate some percentages at the group level based on this Grand total. Unfortunately I cannot access the value for grand total (because its another running total).
Confused?? Ok reports should look like below..
Column 1 | Colunm 2
======== =========
| Group 200 (Running Total Refresh at Group level) | 20% (200%1000) |
| Group 500 (Running Total Refresh at Group level) | 50% (500%1000) |
| Group 300 (Running Total Refresh at Group level) | 30% (300%1000) |
Footer 1000 (Running Total Never Refreshed)
But column 2 doesn't give me the correct value. it gives me 100% always means 200%200 or 500%500 etc.
Any idea how to fix this??
Thanx Lee, using a running total formula worked, I added following formula to the report footer,
numbervar Samples;
if {product.sku}="card-sample" then
Samples := Samples + {#num_qty};
Samples;
Then I use this formula to calculate column 2
Try this
Add a formula field for group percentage and then paste below code in it.
Group total / sum(column)
place this formula at your group level.
I should think your report total wants to simply be a summary field not a running total. Then your column 2 value can be calculated using running total / sum(field);
Here is an example:
I have two columns age and salary.
When age > 18 i want to add the salary.
Initially I used a running total with a condition {age} > 18
That didn't work well so i deleted the running total, and created a formula: if {age} > 18 then {salary} else 0
I then created a summary on that formula field.
Make sense?

Crystal Report: Merge multiples rows in 1

I have data in following format, grouped by plant
Plant1 4500 PCS
Plant2 500 PCS
Plant3 100 PCs
I want it as follows:
Total Production:5100 PCS Plant1:4500 PCS Plant2:500 PCS Plant3:100PCS
You can use a crosstab to achieve this. Group columns by Plant, Sum number of PCS as your summarized field and check the Row Totals on Left option.

counting fields based on group in crystal report

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