Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

ssrs 2008 iif with lookup Expand / Collapse
Author
Message
Posted Thursday, October 03, 2013 12:29 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 3:14 PM
Points: 299, Visits: 341
In a ssrs 2008 r2 report, I have found the following expression and I would like you to explain the following code to me:

=IIF(Lookup(Fields!SK.Value, Fields!SK.Value, Fields!StCount.Value, "DS_StCount") = Nothing, 0, Lookup(Fields!SK.Value, Fields!SK.Value, Fields!StCount.Value, "DS_StCount"))


I know that a lookup function compares the first values to see if they are equal, and if so they value in the third column is returned. However I do not know what this enire
iif statement is doing. Can you explain it to me?
Post #1501318
Posted Thursday, October 03, 2013 12:36 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 7:16 AM
Points: 1,654, Visits: 5,206
It is looking up the value in the SK column from the bound dataset to the "DS_StCount" dataset and if it does not return a value, it uses zero.

The lookup function is a bit like a left outer join in this case between the active groups dataset and "DS_StCount" on SK.value.


MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1501320
    Posted Thursday, October 03, 2013 2:03 PM
    SSC Veteran

    SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

    Group: General Forum Members
    Last Login: Yesterday @ 3:14 PM
    Points: 299, Visits: 341
    What do you mean by the 'bound dataset'?
    Post #1501346
    Posted Thursday, October 03, 2013 3:15 PM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Today @ 7:16 AM
    Points: 1,654, Visits: 5,206
    the report item containing the formula must exist within a section off the report that is bound / linked to a dataset

    MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1501358
    « Prev Topic | Next Topic »

    Add to briefcase

    Permissions Expand / Collapse