locked
COUNT OF ROWS RRS feed

  • Question

  • Hi ,

    I want to find count of rows of a particular data set in a table expression. How to do that? Can you please help me out.

    Thanks

    susheel


    sush

    Friday, March 7, 2014 3:55 PM

Answers

    • Proposed as answer by Murali dhar Friday, March 7, 2014 4:50 PM
    • Unproposed as answer by susheel1347 Friday, March 7, 2014 7:59 PM
    • Marked as answer by susheel1347 Monday, March 10, 2014 12:22 AM
    Friday, March 7, 2014 4:16 PM
  • =Count(1,"ScopeName") or =Count(1)

    This is a generic representation. What you count is unimportant. The scope in which you count is everything. The formula you use determines how you use it. Since the first one sets the scope for the count, it can be used pretty much anywhere. The second one is context-driven. Whatever the scope of the containing control determines the scope of the expression. For instance, if I use it in a cell that is under a group for Category, it will show the count of records in each category.

    In the first, for a count of records in the dataset, substitute the dataset name for "ScopeName" (need quotes around the dataset name). You can do the same for any valid scope, such as a group name.


    "You will find a fortune, though it will not be the one you seek." - Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

    Friday, March 7, 2014 10:22 PM
  • If you want the total count/number of rows in a dataset, use CountRows("Dataset1").

    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance
    SQL Server Integration Services: Business Intelligence

    • Marked as answer by susheel1347 Monday, March 10, 2014 12:22 AM
    Saturday, March 8, 2014 8:36 AM
  • CountRows("Datasetname")

    will give your count of rows in dataset (total rows)

    If you want count of values in a particulat field in dataset use

    COUNT(Fields!FieldName.value,"dataset")

    this wil give you count of values in the field after ignoring null values


    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

    • Marked as answer by susheel1347 Monday, March 10, 2014 12:23 AM
    Saturday, March 8, 2014 9:27 AM
  • susheel.. I found it :) In the row group delete the details grouping.. or default grouping.. then you can achieve what you wanted. 
    • Proposed as answer by Murali dhar Monday, March 10, 2014 12:20 AM
    • Marked as answer by susheel1347 Monday, March 10, 2014 12:21 AM
    Monday, March 10, 2014 12:20 AM

All replies

    • Proposed as answer by Murali dhar Friday, March 7, 2014 4:50 PM
    • Unproposed as answer by susheel1347 Friday, March 7, 2014 7:59 PM
    • Marked as answer by susheel1347 Monday, March 10, 2014 12:22 AM
    Friday, March 7, 2014 4:16 PM
  • Hi Murali,

    Thanks for the reply. Tried it. But its not working.


    sush

    Friday, March 7, 2014 8:01 PM
  • =Count(1,"ScopeName") or =Count(1)

    This is a generic representation. What you count is unimportant. The scope in which you count is everything. The formula you use determines how you use it. Since the first one sets the scope for the count, it can be used pretty much anywhere. The second one is context-driven. Whatever the scope of the containing control determines the scope of the expression. For instance, if I use it in a cell that is under a group for Category, it will show the count of records in each category.

    In the first, for a count of records in the dataset, substitute the dataset name for "ScopeName" (need quotes around the dataset name). You can do the same for any valid scope, such as a group name.


    "You will find a fortune, though it will not be the one you seek." - Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

    Friday, March 7, 2014 10:22 PM
  • If you want the total count/number of rows in a dataset, use CountRows("Dataset1").

    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance
    SQL Server Integration Services: Business Intelligence

    • Marked as answer by susheel1347 Monday, March 10, 2014 12:22 AM
    Saturday, March 8, 2014 8:36 AM
  • CountRows("Datasetname")

    will give your count of rows in dataset (total rows)

    If you want count of values in a particulat field in dataset use

    COUNT(Fields!FieldName.value,"dataset")

    this wil give you count of values in the field after ignoring null values


    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

    • Marked as answer by susheel1347 Monday, March 10, 2014 12:23 AM
    Saturday, March 8, 2014 9:27 AM
  • Hi Visakh,

    I used countrows. If the dataset set contains 12 rows I am getting the o/p as shown below. I just need one row. Can please help me out.

    Thanks


    sush

    Sunday, March 9, 2014 7:24 PM
  • Hi Dimant,

    I used countrows. If the dataset set contains 12 rows I am getting the o/p as shown below. I just need one row. Can please help me out.

    Thanks


    sush

    Sunday, March 9, 2014 7:26 PM
  • So you are not using text box? I tried and I'm getting same result if using tabular.. 
    Sunday, March 9, 2014 11:59 PM
  • susheel.. I found it :) In the row group delete the details grouping.. or default grouping.. then you can achieve what you wanted. 
    • Proposed as answer by Murali dhar Monday, March 10, 2014 12:20 AM
    • Marked as answer by susheel1347 Monday, March 10, 2014 12:21 AM
    Monday, March 10, 2014 12:20 AM