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

How to sum specific columns in telerik reporting

3 Answers 1752 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sharan
Top achievements
Rank 1
Sharan asked on 13 Dec 2011, 08:52 AM
Hi,

I have some columns say sales tax,amount,reimbursable(boolean flag). Now at the end I need to display the totals of amount whose reimbursable flag='True'.
for eaxample there are 10 rows out of which 5 rows have only reimbursable flag='true' then i need to display the amounts total only for those 5 rows. please help me in regarding this.

regards
sharan

3 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 14 Dec 2011, 11:46 AM
Hello Sharan,

Yes, this is doable by nesting functions: Sum() will give you the whole sum. However if you use IIF() you can filter the data:

Sum(   IIF(Fields.Flag == True, Fields.Amount, 0)  )
this says: if the Flag is true get the value, otherwise return 0. This way, you should get the correct summing. Regards,
Elian
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Steve
Top achievements
Rank 1
answered on 06 Mar 2013, 10:18 PM
Hi.

I am new to telerik reporting. I have a report like this...

Transfer ID                     FromAcct    ToAcct    Amount
         1                              123           456          20.02
         2                              123           456          40.15
In my report footer, I have a textbox in which I am setting the expression as "=Sum(Fields.Amount)" to get the total amount which is 60.17 But, instead of that I am getting 20.0240.15. Appreciate your help on this............
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 11 Mar 2013, 09:20 AM
Is the Amount field by any chance string?
Try the following expression instead:
"=Sum(CDbl(Fields.Amount))"
and if this works, try to figure out, why isn't your data read as numbers.
Tags
General Discussions
Asked by
Sharan
Top achievements
Rank 1
Answers by
Elian
Telerik team
Steve
Top achievements
Rank 1
Hadib Ahmabi
Top achievements
Rank 1
Share this question
or