Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS tablix split report into two sets of columns

I have a report that lists some basic data about a company for all (possibly) 52 weeks of the year. The report takes in parameters of year and UptoWeek. So for example i can put in 2013 and 31 and it will spit out all the values for year 2013 up to week 31. Right now it looks like:

 Week  Dollars   PY Dollars   Change
 1     5         4            1
 2     20        25           -5
 ...
 52

I want it to split into two sets of columns at the halfway point, so the left side is 1-25 and the right side is 26-52 like so

 Week  Dollars   PY Dollars   Change    Week  Dollars   PY Dollars   Change 
 1     5         4            1         26
 2     20        25           -5        27
 ...                                    ...
 25                                     52

Is this possible in tablix?

The one thing I was thinking was to just copy the tablix next to itself and hide rows higher than 25 on the left, and lower than 26 on the right. I'm just not sure if that's the best way to handle this...

like image 351
d90 Avatar asked Oct 04 '13 12:10

d90


People also ask

Can we use two datasets in SSRS?

Although in SSRS you can use fields of only one dataset but you can use the aggregated value of the another dataset if the field in the another dataset is numeric.


1 Answers

You could set up a column group based on an expression like:

=IIf(Fields!Week.Value <= 26, 1, 0)

Note that this is set to 26, as 26 really should be on the left side, I think.

Your row group expression will need to be something like:

=(Fields!Week.Value - 1) Mod 26

So say I have data like this:

enter image description here

(snip)

enter image description here

And a tablix like this, grouped as above:

enter image description here

With the above grouping, this works for me:

enter image description here

(snip)

enter image description here

This will split your data into two groups based and week and as such will meet your requirements. Since you're only interested in two groups and have a ready-made row number in Week, you can keep the expression simple.

Side-by-side tablixes would most likely be fine, too, but SSRS is notoriously temperamental with adjacent objects. Using grouping as above keeps this as one item at the designer level.

like image 80
Ian Preston Avatar answered Nov 15 '22 10:11

Ian Preston