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!

Summary conditional 1

Status
Not open for further replies.

Bentk

Programmer
Feb 18, 2005
9
US
I need to summarize at field conditionally in crystal 8

I need to summarize all the feild "sales" based on this
where column a=1 and column b=1 then summarize all "sales" rows where that condition is met

I don't want to summarize the "sales" feild where a=1 and b=3

Thanks in advance,

Bentk
 
[ol][li]If that is the only summary you are totalling, then include the condition in your record selection formula. Then all you have to do is summarize the sales field.[/li]
[li]Or you could use a running total and use the formula option to set the condition[/li]
[li]Or you could create 3 three formulas[/li]
Code:
//Initialize variable and place in report header
shared numbervar totsales := 0;
Code:
//accumulate sales
shared numbervar totsales;
if {table.columna} = 1 and {table.columnb} = 1 then
totsales := totsales + {table.salesfield}
else totsales := totsales;
Code:
//Display total sales
shared numbervar totsales;
totsales
[/ol]

-LW
 
IF you only want those values in the report, then filter all others out by using the Report->Edit Selection Formula-Record and place:

(
{table.columna}=1
and
{table.columnb}=1
)

If you want the other data in the report, but need tailored summaries for just that condition, insert a running total and in the Evaluate->Use a Formula place:

(
{table.columna}=1
and
{table.columnb}=1
)

-k
 
Thanks you all for the help. This worked like a champ.

Bentk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top