ohhzumm
ohhzumm

Reputation: 98

Count number of appearance in a column in SSRS

I just want to ask if there is a way to count the appearance of data in a column like this on SSRS:

enter image description here

I would really appreciate your help on this.

Thanks in advance. :)

Upvotes: 0

Views: 124

Answers (2)

SQL_Lemming
SQL_Lemming

Reputation: 119

Create another tablix and group it by the fruit column (make sure to add the group header).

Delete the detail row and the table header row so you are just left with the Group header.

If you want it all in one cell then use an expression something like =Field!Fruit.value & ": " & count(Field!Fruit.value)

You could always put the table inside the header or footer cell of the containing table

Upvotes: 1

Ross Bush
Ross Bush

Reputation: 15175

  1. First way - Add another table "tblGroups" after your detail
  2. Second way - Add another row as the last row in the Fruits table outside of any grouping. Place "tblGroups" there.

  3. Set a grouping condition "myFruitGroup" for tblGroups to =Fields!FruitID.Value

  4. Set your text like <Expression>=Fields!FruitName.Value+" : "+CSTR(COUNT(Fields!Fruit.ID,"myFruitGroup"))

Upvotes: 0

Related Questions