Indicator for to remain in one cell for a group

  • In SSRS, I have a drill down report with three columns. One column says 'yes' or 'no.' The other column is for an indicator. And then there is the Group column. Each group will open up their yes or no cells. Is there a way for the indicator to remain in the first cell of each group? I want to be able to look at a Group and if it has an X then I know there must be a 'no' in the yes/no column. I just don't want to open up the group and have an X or check mark next to each 'yes' or 'no.' Thanks!

  • I figured it out by using the Rectangle but now how to make that indicator see the yes/no column. My expression for the indicator corresponding to yes/no/null is:

    =Fields!Passed.Value*100

    with red: 50 to 100, yellow: 41 to 49, and green: 0 to 40. Somehow this works but now I just want one indicator for a group if an X is present or if there is an exclamation if there are any nulls, else everything should be a yes and therefore a checkmark. Is this an if/else? If so, can anyone point me in the right direction on how to write it. Thanks!

  • Have you tried the concept of drilldown in ssrs? Read this article I wrote on creating a drill down report .. http://sqlsaga.com/ssrs/how-to-create-a-drill-down-report-using-ssrs/[/url]

    Good Luck 🙂 .. Visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • Add an indicator within the group and set it's expression to use SWITCH to return a suitable value to show the relevant indicator

    Use IIF to test the field for yes and return 1 or zero, put this in a SUM

    Add SUM to the SWITCH and test the value of SUM to be > zero to return a value for the required indicator

    Repeat this for no and null

    e.g.

    =SWITCH(SUM(IIF(Fields!Passed.Value='yes',1,0))>0,1,SUM(IIF(Fields!Passed.Value='no',1,0))>0,2,True,3)

    (Set the indicators test ranges to 1,2 and 3 accordingly)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • I don't think the SUM will work in this case because there is a mix of indicators with values of 0, -1, 1. For the individual indicators I have: =CInt(IIF(Fields!Passed.Value, 1, iif(Fields!Passed.Value is nothing, -1, 0))) and this works fine. So for the Group column I need it to find if there is first, a 0 in the group of indicators, and display that but if there is also a -1, then display that instead. If neither are present, then it must all be a 1. Here is what I have: =Min(CInt(IIF(Fields!Passed.Value is nothing, 0, iif(Fields!Passed.Value, -1, 1)))) which is not working properly especially when there is all of one kind. Could it be the order that I have them in?

  • Try this

    =Switch(Sum(IIf(Fields!Passed.Value, 1, 0))>0,1,Sum(IIf(IsNothing(Fields!Passed.Value), 1, 0))>0,-1,True,0)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Thanks but it doesn't work. If a 1 appears before a 0, it stops and only displays the 1. I need it to search for a 0 first, then -1, then 1. So I was thinking the MIN function would do the search but with a little switch of the 0 and -1 so 0 is the MIN. Or, if that's not possible, then to switch the ranges in the indicator fields.

  • How about this

    =Switch(Sum(IIf(IsNothing(Fields!Passed.Value), 0, IIf(Fields!Passed.Value, 0, 1)))>0,0,Sum(IIf(IsNothing(Fields!Passed.Value), 1, 0))>0,-1,True,1)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • It looks like it works! Thank you so much! Can you explain to me why you use SUM instead of MIN?

  • giszzmo (4/30/2014)


    It looks like it works! Thank you so much! Can you explain to me why you use SUM instead of MIN?

    Because MIN will not obey 0, -1, 1 order

    If the dataset contained entries for all three values (true, false and NULL) you would have values 1, 0 and -1 and MIN would return -1 not 0 as you wanted

    *Edited*

    if you want to use MIN then you would have to use the values 1, 2 and 3 in the correct order and change the indicator ranges

    Far away is close at hand in the images of elsewhere.
    Anon.

  • I see. And there is no way at all to trick MIN to see 0 instead of -1?

  • Awesome! Thank you so much for your help!

  • No. As I already stated you would have to use different values (and changing indicator ranges) to get MIN to work the way you want.

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply