+ Reply to Thread
Results 1 to 3 of 3

Thread: For each, if and if not statements?

  1. #1
    Barn Regular CCCSteve is on a distinguished road CCCSteve's Avatar
    Join Date
    Feb 2010
    Posts
    63
    Rep Power
    2

    For each, if and if not statements?

    Hello everybody,

    I am brand new to SSRS and am having some issue finding out how to constuct logical statements and was wondering if you all had any idea. First off my statement that I need to construct will consist of the following:

    For each item where status = "Inactive"

    If resultA = "No" then a specific cell = Value 1 + Value 2 + Value 3 * Percentage

    If resultA = "yes" then do not include a payment amount (already calculated)

    Result of either items is then divided by a number (already calculated) to get a percent(%)

    I hope I explained this well enough and hopefully can get some feedback on how to setup this formula. Thanks in advance for your help!
    Last edited by CCCSteve; February 16th, 2010 at 11:57 AM.

  2. #2
    I like Data Cubes too... Lauramc has a spectacular aura about Lauramc has a spectacular aura about Lauramc's Avatar
    Join Date
    Mar 2008
    Location
    Far Far Away
    Posts
    387
    Real Name
    Laura
    Rep Power
    5

    I believe the IIF statement would work for you. Here's an example that I use in the background color property for alternating colors:
    Code:
    =iif(rownumber(nothing) mod 2 = 0,"lightGrey","white")
    
    Your code might be something like this:
    Code:
    =IIF(Fields!status.value = Inactive, "0", (Fields!value1.value + Fields!value2.value + Fields!value3.value) * Fields!Percentage.value)
    
    Of course this assumes that all your values are in fields within the dataset you are working in.

    If the result of this can be zero or null, keep in mind that you do not want to then divide the result by anything because you will get a divide by zero error.

    Give this a try and let me know if you have any further issues with it.
    "The Enrichment Center is required to remind you that first you will be baked, then there will be cake." - GLaDOS

  3. #3
    Barn Regular CCCSteve is on a distinguished road CCCSteve's Avatar
    Join Date
    Feb 2010
    Posts
    63
    Rep Power
    2

    Great!

    I will give this a try, thanks for your reply

+ Reply to Thread

Similar Threads

  1. if statements help
    By Rebelle in forum ASP Development
    Replies: 3
    Last Post: August 17th, 2009, 02:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO