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


SSRS Indicators Expression


SSRS Indicators Expression

Author
Message
davdam8
davdam8
Say Hey Kid
Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)

Group: General Forum Members
Points: 704 Visits: 668
Hi geniuses, I'm stuck here with some indicators.

Here is my table:

[valueType] | [Value]
Allocation | 3000000
Value Planned | 5000000

I have to use a 4 Traffic Lights indicator where:

Green if Allocation >= Value Planned
Yellow if Allocation/Value Planned is > 0,7 and < 1
Red if Allocation/Value Planned is < 0,7
White if Value Planned is = 0

For the expression
Dataset: DataSet2BFM
valueType field name: valueType
Value field name: Value

The big problem i'm facing here is the indicator expression.

Thanks in advance!

Regards
anthony.green
anthony.green
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24928 Visits: 6519
Is the table split over two rows as shown or is it split over 4 columns?

Also will the table only ever have the same two values in it, one for allocation the other value planned?



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


davdam8
davdam8
Say Hey Kid
Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)

Group: General Forum Members
Points: 704 Visits: 668
2 Columns and a valueType has a respective value.
And what I need is to compare the value from allocation and the one from Value Planned.
anthony.green
anthony.green
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24928 Visits: 6519
So something like should do the trick

=SWITCH
(
LAST(Fields.Value.Value "DataSetName") = 0, "White",
FIRST(Fields!Value.Value "DataSetName) >= LAST(Fields!Value.Value "DataSetName"), "Green",
(FIRST(Fields!Value.Value "DataSetName) / LAST(Fields!Value.Value "DataSetName")) >= 0.7, "Yellow",
(FIRST(Fields!Value.Value "DataSetName) / LAST(Fields!Value.Value "DataSetName")) < 0.7, "Red"
)

Would need to ensure that the table is ordered so that Allocation is the first value and Value Planned is the last value.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


davdam8
davdam8
Say Hey Kid
Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)

Group: General Forum Members
Points: 704 Visits: 668
Certainly the parenthesys have their importance here.
Could you check what you wrote above?
Thanks

Regards
anthony.green
anthony.green
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24928 Visits: 6519
Looks fine to me



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


davdam8
davdam8
Say Hey Kid
Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)

Group: General Forum Members
Points: 704 Visits: 668
OK, It is not working, but your suggestion brought me an ideia.
It is possible to use an indicator expression where - if the value from 'Textbox1'="Green" - show green indicator.

I'm learning here, sorry if my questions expose stupidity!

Thanks
Regards
anthony.green
anthony.green
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24928 Visits: 6519
Try this instead

missed a few , and " out

=SWITCH
(
LAST(Fields!Value.Value, "DataSet1") = 0, "White",
FIRST(Fields!Value.Value, "DataSet1") >= LAST(Fields!Value.Value, "DataSet1"), "Green",
(FIRST(Fields!Value.Value, "DataSet1") / LAST(Fields!Value.Value, "DataSet1")) >= 0.7, "Yellow",
(FIRST(Fields!Value.Value, "DataSet1") / LAST(Fields!Value.Value, "DataSet1")) < 0.7, "Red"
)



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


davdam8
davdam8
Say Hey Kid
Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)Say Hey Kid (704 reputation)

Group: General Forum Members
Points: 704 Visits: 668
OK thanks. But still not working.
Change of plan!
Table:
[valueType]|[Value]|[Expr1]|[Expr2]|[INDICATOR(4TrafficLights)]
[Allocation]|[3000000]|[ValuePlanned]|[5000000]

This way it may be easier, no?
With same conditions.
Can you write me the expression for this example?

Thanks!
anthony.green
anthony.green
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24928 Visits: 6519
=SWITCH
(
LAST(Fields!Value.Value, "DataSet1") = 0, 0,
FIRST(Fields!Value.Value, "DataSet1") >= LAST(Fields!Value.Value, "DataSet1"), 3,
(FIRST(Fields!Value.Value, "DataSet1") / LAST(Fields!Value.Value, "DataSet1")) >= 0.7, 2
(FIRST(Fields!Value.Value, "DataSet1") / LAST(Fields!Value.Value, "DataSet1")) < 0.7, 1
)


You should just need to substitute the word to a number then set the start and end range for each colour in the indicator to the right value

Had my head in background colours as been working on changing cells to different colours based on values all day.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


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