Changing row color based on value in a table - sql

I need to change the color of a row based on the value I have being stored in a table. I have a 1 row 1 column table that contains the average run time of any selected report based off its last 30 runs. I would like to color the row green if the report runs in a given proximity of this value and red otherwise. How would I go about writing the IIF for this in SSRS?

Your IIF code is going to look something like this to have a criteria to change the color of the fields.
IIF(Fields!RunTime.value < AllowableValue,"Green","Red")

Related

Conditional styles on a calculated value in Cognos

I have a report (Pivot table) for which I have a value everyday. My goal is to calculate the variance every day and highlight with conditional styles.
1 jan. 23
2 jan. 23
3 jan. 23
5
25
42
I have a query who calculates the variance between days in % (which I dont want to put in the report).
My conditional style rule is [Table].[Pourcentage variation D-1] between 0,05 and 10.
Since my request is not in displayed my report, I have this error :
RSV-VAL-0032 The following expression is not valid. If the item exists
in a query but is not referenced in the layout, add it to a property
list.
The problem is that I don't have the "Proprety list" in my pivot table like in can have in a Data table.
How can I highlight my variance based on a request that I dont display in my Pivot table ?
Thanks for helping
Add the calculated field to the pivot table (I know you do not want this in the layout, this is just to test if that removes the error). See if the conditional style works the way you expect.
If so, change the column for the percentage data item to property, set box type to none. This way it is still something that can be referred to, but is hidden from the final result

Limit number of script triggers by field

I am trying to figure out how to limit the number of times an ID can be selected.
I have a list of mentors, some who can be selected 1 time and others who can be selected 2 times. I am using a button that performs a Set Field script. When the button is clicked the ID value is copied to another list. It remains in the original list but also is shown in another. I want to say something like:
If field "mentor count" = 2 then You can select 2 times, else you can select 1 time.
I have no idea how to go about it.
Do you have any suggestions please?
There are a total of 3 lists. One is mentors, 1 is students and the other is both. The user selects a mentor and student to match up. Each row in this table is a new match.
I tried conditional action which failed. I am thinking I will need a script.

Running total on calculated column in SQL Server

I am using SQL code to get the running total of a column which repeats itself, in my screen shot below, the column WeightedBilled is calculated and I use it on the report on group level as MAX(WeightedColumn).
Now I want to add a column that adds the values of WeightedBilled and pick up just one value of the said column.
When I use over partition by clause, it adds all repeating values.
My code is:
SUM( WeightedBilled) OVER (PARTITION BY(CheckProjID), rpt_tEmployeeName) AS EmpLevelWeightedBill`,
On the SSRS 2005 report side: the dark background is where I want the sum of the values.
Employee $2000 (this is what I need here)
Project 1 $500 (displayed as max(weightedBilled))
Project 2 $600 (displayed as max(weightedBilled))
Project 3 $700 (displayed as max(weightedBilled))
Project 4 $200 (displayed as max(weightedBilled))
[Report Layout]
You question is not that clear but assuming you want to add up the max values of a field and also assuming that you have a row group by employee called EmployeeRowGroup then the expression would look like this.
=SUM(MAX(Fields!WeightedBilled.Value, "EmployeeRowGroup"))
The row group is case sensitive and must be enclosed in double quotes.

SSRS insert exact specific value in a cell of a Matrix using expression

I'm not sure if my question is really stupid, but I found nothing on the internet...
Is it possible to insert a specific value in a cell of a matrix?
for example I have a dataset like below:
Month Prod Amount
2 X 34$
11 Y 12$
7 Z 150$
and a matrix like:
-------| Month |
Prduct |SUM(Amount)|
So the row group are products and column group are the months of a specific year.
If I want to add an extra column, with a specific value chosen dynamically from the amount (for xample 150$) so to have
-------| Month |columnName
Prduct |SUM(Amount)| 150
is that possible? also if the value is repeated through the column (it would be useful if I wanted the new column to have this specific value added for each value)
thanks a lot!! :D
You can insert a value directly in your matrix but it will be repeated for each record.
The best way is to add a new column with conditional values is to do this in your dataset query. Probably with a CASE statement if you are using SQL.
EDIT: If you can't adjust the query for whatever reason, you can add the new column and use SWITCH function inside your textbox to achieve the same.

How to find categorical outlier/noise rows in bigquery window

How would i detect outlier rows in bigquery and mark rows as outliers. For each row, I want to look at 5 rows before and 5 rows after and see if the value changed.
Here is an example of a table.
In this table I would want the highlighted rows to have some boolean flag to say outlier because the rows only change for a brief second. However, when it changes from id 19 to 5, that is okay (assuming that is a continued change). Basically I am trying to remove glitches where it just changes from one user id to another for 2 rows, so i want to mark those rows with some flag. I was thinking of doing this in bigquery by looking at lag rows and lead rows in a given window (over a partition), but am not sure if i am on the right path.
This isn't a typical "outlier" case as all rows should have the same value except for the glitches and it is more of a categorical variable, albeit a number.