SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Indicators for Text


Indicators for Text

Author
Message
sharonsql2013
sharonsql2013
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1258 Visits: 1265
I need to show a Green Indicator if Fieldname!Status.Value is "Yes" and Red for No, How can I achieve this?
pietlinden
pietlinden
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13740 Visits: 14115
Got one to work... The part that tripped me up is that the gauge is expecting a numeric value for the state, so if you pass a string/text to it, it won't work. I started with this dataset

SELECT        1 AS QID, 'Yes' AS Answer
UNION ALL
SELECT 2 AS Expr1, 'No' AS Expr2
UNION ALL
SELECT 3 AS Expr1, 'Yes' AS Expr2
UNION ALL
SELECT 4 AS Expr1, 'No' AS Expr2
UNION ALL
SELECT 5 AS Expr1, 'Yes' AS Expr2



and it didn't work (no numeric value to connect to, because Expression2 is text.)

When I created a calculated value to convert Yes/No to 1/0, then it worked. I attached a super simple example. You could do the calculation for the indicator in your query/stored procedure instead of doing it in the report. I just did it that way to make it self-contained.

I removed the yellow light in my example, since it was mapping yes/no values to green/red.

HTH
Pieter
Attachments
TestIndicator.rdl (6 views, 19.00 KB)
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