Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Indicator for to remain in one cell for a group


Indicator for to remain in one cell for a group

Author
Message
giszzmo
giszzmo
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 124
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!
giszzmo
giszzmo
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 124
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!
a4apple
a4apple
SSC Veteran
SSC Veteran (202 reputation)SSC Veteran (202 reputation)SSC Veteran (202 reputation)SSC Veteran (202 reputation)SSC Veteran (202 reputation)SSC Veteran (202 reputation)SSC Veteran (202 reputation)SSC Veteran (202 reputation)

Group: General Forum Members
Points: 202 Visits: 406
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/

Good Luck Smile .. Visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.
David Burrows
David Burrows
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8237 Visits: 9566
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.


giszzmo
giszzmo
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 124
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?
David Burrows
David Burrows
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8237 Visits: 9566
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.


giszzmo
giszzmo
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 124
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.
David Burrows
David Burrows
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8237 Visits: 9566
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.


giszzmo
giszzmo
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 124
It looks like it works! Thank you so much! Can you explain to me why you use SUM instead of MIN?
David Burrows
David Burrows
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8237 Visits: 9566
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.


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search