Conditional Formatting based on parameter value - sql-server

I have a report in Report Builder 3.0 which has 2 parameters, #LocalAuthority and #FiscalYear, neither of these are multi value.
The main basis of the report is a matrix which shows certain figures for Wards within a Local Authority
Ward Fig A Fig B Fig C
Springfield 50 60 40
Grange Hill 20 60 90
I want to try and conditional format my figures based on the previous fiscal year. For example if the above table was showing Fiscal Year 2018/19 and the one below is showing Fiscal Year 2019/2020 I want the text to change colour depending whether there has been an increase or not.
Ward Fig A Fig B Fig C
Springfield 60 60 40
Grange Hill 20 60 80
So Springfield Fig A has increased so I would like it to show red and Grange Hill Fig C has decreased so I would like it to show green.
Have tried this as an experiment
=iif(Fields!Fig A.value > Previous(Fields!Fiscal.value),"Yellow","Purple")
but it would seem you are unable to use 'Previous' in a matrix

I would suggest returning this year and last year data on the same row so that the report in Report Builder has the information it needs to display nicely. In this example, "LY" means "Last Year" and "TY" means "This Year". Report Builder can then choose "Yellow" or "Purple".
Ward LY_Fig_A LY_Fig_B LY_Fig_C TY_Fig_A TY_Fig_B TY_Fig_C
Springfield 50 60 40 60 60 40
Grange Hill 20 60 90 20 60 80

Related

Data Studio - Percentage Breakdown from multiple columns

I have a Google Sheet connected to a Google Data Studio file. The data is structured as follows:
ID Stream1 Stream2 Stream3 Total
001 10 5 5 20
002 5 10 15 30
003 100 20 5 125
004 50 0 0 50
Is there any way in Data Studio to produce a percentage breakdown of the Total field based on the various Stream fields? I was thinking of a Tree map chart, so Stream1 should have a box showing 8.8%, Stream2 13.3% etc.
In your DataStudio, Create a new field called "Stream1%". In the definition of that field, code up the Formula as "Stream1/Total". This will give you a new field you can add to your tables and charts. You can now add "Stream1%" into your table and flag it as Numeric > Percentage. You will now have a column the result you want.

Aggregate metric per date

I have a data source with data formatted like this:
ID
Visits
Charges
Date
Location
33
21
375
2022-01-29
A
34
4285
4400
2022-01-29
B
35
12
2165
2022-01-29
C
36
31
4285
2022-01-30
A
37
40
5881
2022-01-31
A
38
29
4715
2022-01-31
B
39
8
1390
2022-01-31
C
I want to get the aggregated visits of all locations per day, and from there getting the Max value of a day for the time period chosen by the user on a ScoreCard and a Table. At the moment when i choose the max value of the metric visits it only gives me the max value of column (4285), not for the aggregated data per day.
The value i am looking for, in the time period between 28-01 and 31-01 should be 4318 (the sum of all 3 locations for the 29-01, which is the highest of the 3 days)
Thanks!
What I may suggest is to use Pivot Table like this:
You choose Date as your row dimension. Then you choose Visits as metric (aggregation set as SUM).
Remember to sort this table by Visits in descending order. Your maximum value should be on top. If you want to see only this maximum value, you can change size of your pivot table to keep only first value visible.
This should work with additional controls too.

SQL Query for Pagination

I have students data for their fees paid for each program, now I want to show the outstanding fees, now since it's possible student could have their outstanding fees for 2018, 2019 and 2020 pending, hence it will have 3 rows (The months will be in columns). Now since the student is same, I will be clubbing the records in the front end, now if I consider pagination and I have 10 per page limit, and in these 10 records 3 records is of the same student (since year was different), in that case I will end up having just 7 records on given page.
Here's the sample data.
Studentname RollNo Year Program Jan Feb Mar Apr May Jun ...
abc 1 2018 p1 200 50 10 30 88 29
abc 1 2019 p1 100 10 20 50 12 22
abc 1 2020 p1 30 77 33 27 99 100
xyz 2 2020 p2 88 29 32 99 199 200
How could I manage pagination for above case.
Assuming your front end is HTML/CSS/Javascript:
You don't need to handle pagination in your query - or even your backend - at all. Everything can and should be done on your frontend. I would suggest using JQuery and Bootstrap to create a paginated table to display your data using Material Design for Bootstrap

How to sum SSRS Matrix Columns on Row Group

I have a report that displays the total hours a person worked for each project they are assigned to, aggregated on month. I would like to sum the total hours for each person, for each month, in SSRS 2008 R2. So, for example, I have the follow data and would like to column totals like so:
January February March
Worker 1
Project1 50 80 20
Project2 30 10 60
Project3 10 40 5
Total: 90 130 80
Worker 2
Project1 20 40 60
Project2 10 30 10
Porject3 30 10 50
Total: 60 80 120
Everything I have tried so far either sums each column for all workers combined (summing by 'Month' column group) or sums all hours for each worker (Summing by 'Person' row group).
For completeness, my row groups are:
Person
Project
RowGroup
My Column groups are:
Month
ColumnGroup
I know that I can create another query/data set to do this, but I was hoping that SSRS can do this fairly easily. It seems like a trivial problem and perhaps I am just missing something.
Any help would be great or perhaps this is something that SSRS can't do.
If you are trying to add a Column containing totals, it is pretty simple just
right click on cell --> Totals --> Column
As shown here

How to sum a value of rows when searching for specific text

Please see the screenshot, but it's like this:
Column A Column B
User 1 20
User 2 30
User 3 20
User 4 10
User 1 40
User 3 40
User 1 10
User 4 20
User 2 30
User 1 20
User 4 50
User 4 20
User 2 10
This is a simple list, and the actual list is spread across 27 worksheets. But I would like the equation to be on each worksheet.
How do I search Column A for a value of "1" and SUM up the values for Column B. SO I should have a result of 90 for User 1, 70 for User 2, 60 for User 3 and 100 for User 4.
Any help would be appreciated....
This would be for cell C2 (just drag downwards):
=SUMIF(A:A,A2,B:B)
MS Office Help
edit: Had a little mistake there, sorry. Now it should work.

Resources