none
Complex Nested IIF Statement

    Question

  • Is it possible in a nested IIF statement to have the True statement be another iff statement? I know it can in the False field.

    For example, I have multiple counters which I want coloured differently:

    If counter = a then if avg counter value >80, "Red" else if avg counter value <80 AND avg Counter Value >=70, "Orange" else "Black"

    else if counter = b then if avg counter value >80, "Red" else if avg counter value <80 AND avg Counter Value >=70, "Orange" else "Black"

    Else if 100-counter value >80, "Red" else if 100-counter value <80 AND 100-Counter Value >=70, "Orange" else "Black"

    I need to have the iif statements on the counters as well due to some of them needing to be the reverse of the value (which are all in percentages)

    Wednesday, April 16, 2014 5:37 AM

Answers

  • i think you can include all these conditions inside a Switch statement like below

    Switch((Fields!counter.value = "a" Or Fields!counter.value = "b") And Fields!AvgCounter.Value > 80,"Red", 
    (Fields!counter.value = "a" Or Fields!counter.value = "b") And Fields!AvgCounter.Value < 80 And Fields!AvgCounter.Value >= 70,"Orange",Nothing,"Black")

    I didnt understand on last condition as it says 100- counter. As I see counter has values as a,b etc so it doesnt make any sense to do 100 - counter


    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 Jaylaa Thursday, April 17, 2014 12:32 AM
    Wednesday, April 16, 2014 5:47 AM