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

Conditional Footer Totals

2 Answers 360 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John Scott
Top achievements
Rank 1
John Scott asked on 08 Apr 2010, 04:38 PM
Hey there...I have a report that I'm working on and I have a field called AssetOwner and AssetValue....this owner has a possibility of having 3 different values (Self, Spouse, Joint)

I can bind a table and display the raw values without any problems, but at the bottom of the table I want to sum up the AssetValues based on the Asset Owners...like this.


Asset Owner               Asset Type               AssetValue
--------------------------------------------------------------------
Self                            Car                                  $5000
Self                            Boat                                $1000
Spouse                      Jewelry                            $1000
-------------------------------------------------------------------
Self Asset Total:                                                $6000
Spouse Asset Total:                                          $1000
Joint Asset Total:                                                     $0   


I was trying to just do a sum(AssetValue) but I can't find out how to filter that sum for a particular AssetType.


Any help would be really appreciated.



Thanks in advance.


John Scott.

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 13 Apr 2010, 06:40 PM
Hello John Scott,

There is no out of the box solution for your task. Our suggestion is to do the sum calculations in the datasource or to create a table like layout instead of using the table item as explained in the following forum thread and then Access the items from the report to do conditional summation with a global variables.

Sincerely yours,
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.
0
Mayank Tyagi
Top achievements
Rank 1
answered on 26 Jul 2011, 05:46 PM
You can do this with an expression '=Sum(IIf(Condition, value If true, value if false))'

For example the following expression will give me the total value of invoices where the month is = 'Jan'

=Sum(IIf(Fields.Month="Jan", Fields.InvoiceTotal, 0 ))

1. Add new text box to the report footer.
2. Right click the text box and select 'Expression'
3. Use the above format to enter the details you want to sum.
Tags
General Discussions
Asked by
John Scott
Top achievements
Rank 1
Answers by
Peter
Telerik team
Mayank Tyagi
Top achievements
Rank 1
Share this question
or