Reputation: 11393
I use Matrix
in my RDLC
report to group Vertically And horizontally at the same time .But i get a result differs a little from my target .
My Report is like this :
The Current result is something like that:
My target should be like that :
My query dataset is like this :
Company year Tot1 tot2
3001 2016 60.7332300 58.093040
3001 2015 66.1421300 64.754000
3002 2016 211.3360000 94.113000
3002 2015 169.8230000 168.082000
ACCORDING TO alejandro zuleta
Request :
How to change the report to achieve my target ?
Upvotes: 0
Views: 1371
Reputation: 14108
If you can't change your query and you are comparing two different years, you can hardcode the Total 1
and Total 2
.
I created four columns and used these expressions:
=MAX(Fields!Year.Value)
Will return 2016
=MIN(Fields!Year.Value)
will return 2015
To get the values use:
Total 1 for 2016:
=SUM(IIF(Fields!Year.Value=MAX(Fields!Year.Value),Cdbl(Fields!Tot1.Value),0))
Total 1 For 2015:
=SUM(IIF(Fields!Year.Value=MIN(Fields!Year.Value),Cdbl(Fields!Tot1.Value),0))
Total 2 for 2016:
=SUM(IIF(Fields!Year.Value=MAX(Fields!Year.Value),Cdbl(Fields!Tot2.Value),0))
Total 2 For 2015:
=SUM(IIF(Fields!Year.Value=MIN(Fields!Year.Value),Cdbl(Fields!Tot2.Value),0))
You will get:
Note no columns groups were created.
Category
was added as Row Group.
Let me know if this helps.
Upvotes: 1
Reputation: 12243
Ideally you would have your total type and your year as just two columns in your dataset, on which you can then group in your matrix.
To achieve this, you would simply have column grouping levels as follows:
--TotalType
----Year
------Details
Upvotes: 0