0

this is the table

    Provider ID  flag
    A        1    N
    A        2    N
    A        3    D
    B        4    D
    B        5    D
    B        6    N

this is the matrix in ssrs

            Flag        
Provider    N   D   Percentage
A           2   1      N/D
B           1   2      N/D

on the flag columngroup i am doing a count to get the count of N and D

 =Count(Fields!Provider.Value)

How can i calculate the percentage of the flag columngroup ?

fairy
  • 3
  • 2

1 Answers1

0

Can you try following =Reportitems!.value/ Reportitems!.value

in addition to this, take a look into this post for some additional help Calculate Column difference in Matrix

Other way

If you are confirmed that there would be always two different values (N and D) for flag field then you can use Table instead of matrix and there you can achieve percentage easily. To use table, you can go with:

  1. Place a table and do a row grouping on Provider field
  2. In the second column’s textbox, put a expression like =count(IIF(Fields!flag.value=”N”, fields!ID.value,Nothing))
  3. In the third column’s textbox, put a expression like =count(IIF(Fields!flag.value=”D”, fields!ID.value,Nothing))
  4. In the Fourth column’s textbox, put a expression like =reportitems!.value/ reportitems!.value
Aftab Ansari
  • 926
  • 9
  • 17
  • Hi Aftab thanks for the reply. I tried =Reportitems!textbox17.value/Reportitems!textbox17.value and it gives me 1 for the percentages. i am also doing count in textbox17 which is the flag column group. – fairy Sep 07 '14 at 05:41
  • fairy, I have posted a workaround above. Take a look if it works for you. – Aftab Ansari Sep 08 '14 at 03:26
  • Thank you aftab for the reply i used tablix as you have suggested but used different approach by spliting a flag into two columns and did the count in the query select Provider,flag1 =COUNT( case when flag = 'D' then 'D' end ), flag2 = count(case when flag = 'N' then 'N' end) from card group by Provider Thank you for your help :) – fairy Sep 08 '14 at 05:13