This is a migrated thread and some comments may be shown as answers.

How to use TextBox item to combine generate the value of AVG automaticly ?

1 Answer 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mars
Top achievements
Rank 2
Mars asked on 23 Sep 2010, 03:57 AM

A

10

 

 

 

20

 

 

A Total

30

AVG

0.25 (30/120)

B

20

 

 

 

30

 

 

 

40

 

 

B Total

90

AVG

0.75(90/120)

Total

120

 

 


Hello Sir,

I've a problem,
Above sample is a group like Report
The row of A Total and B Total are calculated(Sum) in TextBox control,
I want to use the row of  A Total and B Total to combine generate the value of AVG column automaticly as above sample.
How shoud I do ?
Pls help me,thanks :)

Regards.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 24 Sep 2010, 02:35 PM
Hello Victor Wang,

You can calculate the described average with an Exec(scope, expression) built-in function - it executes the specified expression in the given data scope. Used mostly with aggregate expressions as a second parameter; this function allows changing of the data scope in which the expression is evaluated. Scope parameter is the name of the data scope we need to evaluate the expression against.

Your expression should look like this one:
= Sum(Fields.Price)/Exec("Table1",Sum(Fields.Price))

Best wishes,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Mars
Top achievements
Rank 2
Answers by
Peter
Telerik team
Share this question
or