Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how 1

Status
Not open for further replies.

moawya

Technical User
Jul 18, 2011
2
I'm a beginner in CR v10, I want you to help me to resolve some problems that faced me in formula field to build a summary information for specific data ,
to explain what I exactly want, simply let say I have two tables (A,B),table A has two fields {item-no(as PK),item-name)and its data as the following (item-no=[1,2,3],item-name=[AA,BB,CC]),table B also has two fields {item-no(as FK),item-price)and its data as the following (item-no=[1,2,3],item-price=[30$,50$,50$]),I have grouped two tables using Group Expert I've chosen item-name field from table A then I've added item-price from table B under it,
now I want to build a report that show two fields (item-name,total-price)
where item-name column shows two data ["AA" ,"BB-CC"] and the total-price column should show two formula field, one for total price of all AA items and the other one for the total price of BB and CC items i,
I have used three-formula idea but it was fruitless, sorry for that details but really I want you advice two build this report step by step :( :( :(
 
What have you actually done? Formula fields will add two or more values and will add conditionally. "Fruitless" gives little clue to what might be wrong.

It is also helpful to use the header to identify the problem rather than saying "How".

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
PS. If you're not already familiar with Crystal's automated totals, see FAQ767-6524.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Remove your current group and instead group on the following formula:

//{@grp}:
if {A.item-name} = "AA" then
"AA" else
if {A.item-name} in ["BB","CC"] then
"BB-CC"

Then right click on the price field (in the detail section) and insert a sum at the group level.

Or if you want a horizontal display, insert a crosstab in the report footer where you use {@grp} as the column, and sum of price as the summary field.

-LB
 
Thank you all , I'm so sorry about identifying my problem by 'HOW'
really I missed that ,because my interest goes to solving this issue so I did my best to explain it rather than writing the address of this problem.

Special thanks dedicated for lbass, your proposed solution has succeeded,
kindly ,I want your opinion about the following scenario ,really I don't want to make my issue complex :
if table B contains data not exist in table and vice versa , for example:
table B=(item-no=[1,2,3,4,5],item-price=[30$,50$,70$,50$,60$])
and table A=(item-no=[1,2,3,6],item-name=["AA","BB","CC","DD"])

now I want to calculate the sum of "AA" items , the sum of "BB-CC" which is a combination of "BB" and "CC" items,the sum of "DD" despite it's not exist in table B,the sum of "others" despite it's not exist in table A here I mean item-no 5 that exists in table B but it has not any records in table B
 
If item "DD" is not in table B with a price, what is there to sum? You can do a left join from Table A to Table B in order to show item 6 ("DD"), but there will beno cost associated with it.

Item 5 will not appear in the report if it is only in the price table (Table B).

I'm not sure what results you are looking for. Please lay out the desired results labeling fields with {table.field} and showing sample results that clarifies the issue.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top