Variable question in SSRS reporting

Posted on 2011-10-07
Last Modified: 2012-05-12
I am new to SSRS reporting so bare with me. I am trying to get an aggerate total from setting up a report variable in SSRS. I then need this total to use in another expressoin to come up with a percentage. When I use the field that starts with first it gives me and error the virables(grandtotal) vaue expresson for the report body uses aggregate function first, last or previous. Thes aggregate functions cannot be used in varible value expressions. If i use a summary field it tells me I believe that you can't use a summary field in a variable. I got by setting up another dataset and in the query I use the left function to just look at the first character of the class field to get the total for all non-exempt records. I set the sequel statement to just total for all records that the class begins with a value less than '7'   then I put a summary on the assessment field. The  class number start with 301 and go up to 504 for non-exemp properties. The exempt properties class start at 710. I  included the code below for the report variable that I was trying to set up   I thought setting  up a varible was the correct way of getting the aggegate total instead of adding another dataset. If I have to use the dataset way I will need to add another one for exempt properties.    

=IIF(First(Fields!PClas.Value, "nonExemptClass"))< '7',
Sum(Fields!pbm_TotalAssessment.Value, "nonExemptClass")
I also included a screen shot of the fields.

 Screen shot of the dataset fields Screen shot of the dataset fields
Question by:stevenofva
    LVL 21

    Accepted Solution


    Author Closing Comment

    Thank you PatelAlpesh for the information

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    SQL Subquery assistance 4 68
    CRM 2011  -  Super Simple SSRS Question 2 54
    when creating a subscription get error 1 31
    report c# 9 56
    Steps to solve SSRS SQL 2008 R2 User Access Control (UAC) Permission Error With the introduction of SQL Server 2008 R2 and Vista (Windows 7 as well) came new enhanced security features. One of the features included was User Access Control (UAC) t…
    A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. (htt…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now