Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Column groups issue, might be fixed by using calculated fields?

$
0
0

Hi 

Struggling with displaying data as I would like, I thought using column groups was the best way but as soon as I came up against a group which had more than one activity I realised it created the same number of columns as the examples below show.

I would like 12, 12 and 17 to display as one column with a heading "Holiday", I thought I was on the right track with Illness and Emergency however it turned out they each only had one activity so only displayed one column.

The table layout is as follows

I was using column groups as I then applied a filter to each as follows

=IIF(InStr("," & Join(Parameters!Holiday.Value,",") & ","   ,   "," & Fields!Activity.Value & "," ) > 0 , true, false)

The parameter holiday looks like this

Dataset with example data is as follows

SELECT
  Practice.ibvStaffCategorisation.StaffId
  ,Practice.ibvStaffTotalsCL2Y.Period
  ,Practice.ibvStaffTotalsCL2Y.Activity
  ,Practice.ibvStaffTotalsCL2Y.[Year]
  ,SUM(Practice.ibvStaffTotalsCL2Y.ChargeableMinutes) AS Sum_ChargeableMinutes
  ,SUM(Practice.ibvStaffTotalsCL2Y.NonChargeableMinutes) AS Sum_NonChargeableMinutes
  ,SUM(Practice.ibvStaffTotalsCL2Y.ChargeableAmount) AS Sum_ChargeableAmount
  ,SUM(Practice.ibvStaffTotalsCL2Y.NonChargeableAmount) AS Sum_NonChargeableAmount
FROM
  Practice.ibvStaffCategorisation
  INNER JOIN Practice.ibvStaffTotalsCL2Y
    ON Practice.ibvStaffCategorisation.StaffInternalId = Practice.ibvStaffTotalsCL2Y.StaffInternalId
WHERE
  Practice.ibvStaffTotalsCL2Y.[Year] = @Year
  AND Practice.ibvStaffTotalsCL2Y.Period <= @Period
GROUP BY
  Practice.ibvStaffCategorisation.StaffId
  ,Practice.ibvStaffTotalsCL2Y.Period
  ,Practice.ibvStaffTotalsCL2Y.[Year]
  ,Practice.ibvStaffTotalsCL2Y.Activity
ORDER BY
  Practice.ibvStaffCategorisation.StaffId Asc

Not sure what I am after can be done, the way I am trying it.

I did think of adding a calculated field to create in the example of Holiday activities 11, 12 and 17 as a group called Holiday, Illness activities 24 and 12 as a group called Illness, then I could add a single column group based on the new calculated field? Unfortunately my knowledge of these is very little.

Can anyone shed any light on the above, offer any advice?

Cheers


Cheers Chris


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>