Solved

SSRS Expression IIF Statements

Posted on 2016-09-26
2
71 Views
Last Modified: 2016-09-27
Hi,

I have the below iif statement within my expression. How can I take this further to perform further actions if the result is in fact "B"?

[code][/=IIf(
            (
                  iif
                  (
                        Fields!MandateReference.Value Like "*85397"
                        OR Fields!MandateReference.Value Like "*85398"
                        OR Fields!MandateReference.Value Like "*85399", Fields!Local_Currency.Value," "
                  )
                  /
                  (
                        iif
                        (
                              Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00001"
                              OR Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00002"
                              OR Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00003",
                              Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!Local_Currency.Value, "d_ExcludedHoldingsGFS")," "
                        )
                        +
                        iif
                        (
                              (Fields!MandateReference.Value Like "*85397"
                              OR Fields!MandateReference.Value Like "*85398"
                              OR Fields!MandateReference.Value Like "*85399"), Fields!Local_Currency.Value," "
                        )
                  )
                  >= 0.5
            )
            OR
            (
                  iif
                  (  
                        (Fields!MandateReference.Value Like "*85397"
                      OR Fields!MandateReference.Value Like "*85398"
                      OR Fields!MandateReference.Value Like "*85399"), Fields!Local_Currency.Value," "
                  )
                  /
                  (
                        iif
                        (
                              Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00001"
                              OR Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00002"
                              OR Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00003",
                              Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!Local_Currency.Value, "d_ExcludedHoldingsGFS")," "
                        )
                        +
                        iif
                        (  
                              (Fields!MandateReference.Value Like "*85397"
                              OR Fields!MandateReference.Value Like "*85398"
                              OR Fields!MandateReference.Value Like "*85399"), Fields!Local_Currency.Value," "
                        )
                  )
                  <= 0.3
            ), "A", "B"
     )code]

Thanks.
0
Comment
Question by:Martin Spalding
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
Arifhusen Ansari earned 500 total points
ID: 41816064
You meant to say that if condition went false then you want to do some other validation.
Right?

If this is the case. You can use the iif expression same in the part B of your code.



IIf(
            (
                  iif
                  (
                        Fields!MandateReference.Value Like "*85397"
                        OR Fields!MandateReference.Value Like "*85398"
                        OR Fields!MandateReference.Value Like "*85399", Fields!Local_Currency.Value," "
                  )
                  /
                  (
                        iif
                        (
                              Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00001"
                              OR Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00002"
                              OR Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00003",
                              Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!Local_Currency.Value, "d_ExcludedHoldingsGFS")," "
                        )
                        +
                        iif
                        (
                              (Fields!MandateReference.Value Like "*85397"
                              OR Fields!MandateReference.Value Like "*85398"
                              OR Fields!MandateReference.Value Like "*85399"), Fields!Local_Currency.Value," "
                        )
                  )
                  >= 0.5
            )
            OR
            (
                  iif
                  (  
                        (Fields!MandateReference.Value Like "*85397"
                      OR Fields!MandateReference.Value Like "*85398"
                      OR Fields!MandateReference.Value Like "*85399"), Fields!Local_Currency.Value," "
                  )
                  /
                  (
                        iif
                        (
                              Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00001"
                              OR Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00002"
                              OR Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!MandateReference.Value, "d_ExcludedHoldingsGFS") Like "*00003",
                              Lookup(Fields!MandateReportingName.Value, Fields!MandateReportingName.Value, Fields!Local_Currency.Value, "d_ExcludedHoldingsGFS")," "
                        )
                        +
                        iif
                        (  
                              (Fields!MandateReference.Value Like "*85397"
                              OR Fields!MandateReference.Value Like "*85398"
                              OR Fields!MandateReference.Value Like "*85399"), Fields!Local_Currency.Value," "
                        )
                  )
                  <= 0.3
            ), "A", IIF ( Your new condition , true part, falsepart)
     )
0
 
LVL 14

Expert Comment

by:Megan Brooks
ID: 41816119
Keep in mind that IIF is just a shorthand way of writing a searched CASE, for simple expressions. You might end up with a more readable and easier to debug query if you used CASE.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this short article I will be talking about two functions in the SQL Server Reporting Services (SSRS) function stack.  Those functions are IIF() and Switch().  And I'll be showing you how easy it is to add an Else part to the Switch function. T…
Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

740 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