SSRS BIDS SUMMING A SUM TO PRODUCE A SUM - sql-server

Please see attached images.
On the light blue row I need total percentages next to the total days.
There are 3 classifications : Project, RFC and Support, each has two sub colums (Days and Total%)
I have included a sum for total days added up which is =Sum(Fields!Days.Value)
I now need the TOTAL percentage for each of the 3 classes

You can add a scope to the SUM to specify which Group to sum.
=Sum(Fields!Days.Value,"classification") for example.

Related

Pivot table - Display growth rate with calculated field in Google Sheets

I'm trying to create a calculated field that displays the growth rate in % from one of the numeric columns in my pivot table.
How can I reference a row above the current cell to calculate the growth rate?
=(Current cell - (Current cell - 1 Row)) / (Current cell - 1 Row)
Pivot table
Year
Count
Calculated Field (YoY Growth)
2019
100
2020
300
100%
2021
600
50%
based on instructions:
=(Current cell - (Current cell - 1 Row)) / Current cell
={""; ARRAYFORMULA(IFERROR(B2:B-(B2:B-B1:B999)/B2:B))}
I agree with player0, that seeing your sheet, data, data types and layout would facilitate helping you.
However, I'll venture a solution, sight unseen.
There are actually many ways to address what I think you're asking. This is just one of them.
Suppose that your source numbers are in range A2:A. Place the following formula in some other open column, in the cell parallel to the top number in your source range:
=ArrayFormula(ARRAY_CONSTRAIN({"";FILTER(({A3:A;""}-A2:A)/{A3:A;""},A2:A<>"")},COUNTA(A2:A),1))
I've added in more "parts" than are probably necessary. But I tried to include controls, seeing as I don't know what your data actually looks like.
An alternative is to place the following simpler formula into the cell one below where the top number in your source range is:
=ArrayFormula(IF(A3:A="",,(A3:A - A2:A)/A3:A))
In either case, you'll want to format the column/range where the results will be as percent (Format > Number > Percent).
Obviously, if your source numbers are in a range other than A2:A, you'll need to adjust the ranges in either formula accordingly.

Dynamic Columns in SSRS with Dynamic Row Summing?

So I've got a pretty simple view that looks like this:
Location Month DelRec Warehouse_Number Code Value
Canada November Deliveries Warehouse1 C 11041.2
Canada November Deliveries Warehouse 2 C 0
Canada November Receipts Warehouse 3 C 0
USA November Receipts Warehouse_10 H 2543.2
Ultimately, what I would like to create is a matrix in SSRS that uses 'Code' as a dynamic column name and grouping by DelRec and Location (expanding the number of columns for each code available for that grouping). Easy enough, right? Looks something like this:
Now the next step I've got is to do some conditional summing on these values, which has got me stymied. In particular, for example, in the below data, for Canada, Deliveries need to be summed up together (Warehouse 1 and 2), and then the total of those two subtracted from Receipts (in this case, just Warehouse 3). Ostensibly, this would look something like this:
The problem is, I can't figure out how to do conditional summing (i.e. sum deliveries and subtract them from the sum of receipts), especially when dynamic columns are involved (because we don't know what warehouse numbers might come in future data).
In addition, I actually need a column that has the Total Deliveries and Total Receipts, which is causing me even further difficulty.
Anybody have any idea of how to do this? The result should look something like this:
I've created a a pastebin
with some representative SQL data for insert if anyone would actually like to try this out.
As I understand essentially "Receipts" are credits and can be treated as a positive amount and "Deliveries" are debits and can be treated as a negative amount. To get the correct total you could replace the Sum expression in the bottom right of the matrix with
=Sum(IIF(Fields!DelRec.Value="Receipts",Fields!Value.Value,-1 * Fields!Value.Value))
To get a total line for deliveries and receipts you need to either right click on Warehouse_Number in the matrix, then click on Add Total then click on After.
Alteratively you can right click on Warehouse_Number in the Row Groups and add total from there.
The matrix should now look like this
The report should now look like this
Right clicking on Code in the matrix then "Add Total" -> "After" will add Row Totals as a new column. Note that this will only total "Receipt" or "Deliveries" by Location as the report is grouped Location then DelRec then Warehouse. You could achieve a Receipt Grand Total through either adding extra rows at the bottom of the matrix, or better in my opinion is another table only grouped by DelRec to calculate the DelRec Grand Totals.

Multiplying arrays resulting from multiplying arrays in Excel

I've tried looking through some of the posts and I'm having trouble finding something that will help me in this situation.
I have a spreadsheet that has Total Sales, Retail Price, and Inventory for each week in a year for a list of 100 or so projects. These three pieces of info are displayed as columns repeated for the year, with a row for each item.
I was able to add up the total annual cells (every 3rd column) using SUMPRODUCT((MOD(COLUMN(D3:L3),3)=0)*D3:L3)
The next goal is to get a formula to calculate the weighted average retail. I basically need to find a formula that will end up with the SUMPRODUCT of an array of Sales data and Retail data.
I have tried to use some layering of MMULT and SUMPRODUCT but keep getting #VALUE! errors. Particularly with SUMPRODUCT(TRANSPOSE(MMULT(TRANSPOSE((MOD(COLUMN(D3,L3),3)=0)),D3,L3)),MMULT(TRANSPOSE((MOD(COLUMN(D3,L3),3)=1)),D3,L3)) and with putting braces in there as well =SUMPRODUCT({TRANSPOSE(MMULT(TRANSPOSE((MOD(COLUMN(D3,L3),3)=0)),D3,L3))},{MMULT(TRANSPOSE((MOD(COLUMN(D3,L3),3)=1)),D3,L3)})
Does anyone have any experience with this type of issue? I feel like it should be something that Excel can do without having to have separate sheets to calculate.
For your weighted average:
=SUMPRODUCT(($D$2:$FD$2="Sales")*$D3:$FD3*$E3:$FE3)/SUMIF($D$2:$FD$2,"Sales",$D3:$FD3)
And also, to add up the Sales, you could consider:
=SUMIF($D$2:$FD$2,"Sales",$D3:$FD3)
I am assuming FD is the last column of data for the year, but change it if that is not the case.

Excel function array formula based on sumif to find minimum count

I have some data where I want to find the minimum number of days it takes to reach a total sum based on some criteria.
Essentially the data is like this:
Date Season Recieval
1/01/2006 2006 500
2/01/2006 2006 100
3/01/2006 2006 150
…
10/12/2009 2009 300
etc
Want I want to do is find a formula that finds the minimum number of days it takes to reach a receivals total for the season.
The formula below is what I have tried so far with no avail.
=MIN(COUNT(IF(SUMIFS(C:C,B:B,"2006")>2000,DATA!A:A)))
It doesn't matter what point it starts from, but it must take the minimum number of days to reach the 2000.
Output should be a number eg 39 (39 days consecutive to sum up to receivals of 2000).
Essentially what I want to generate is the minimum number of consecutive days required to reach the total of 2000, regardless of the starting point.
Cheers!
If your Dates are in the range A2:A25 and Recieval in C2:C25, then try this...
=INDEX(A2:A25,MATCH(TRUE,INDEX(SUBTOTAL(9,(OFFSET(C$2:C25,,,ROW(INDIRECT("1:25")),1)))>=2000,),0))-A2
The formula will get you the no. of days to reach total 2000 receival in column C.
Or if you just need to count the consecutive dates, please try..
=MATCH(TRUE,INDEX(SUBTOTAL(9,(OFFSET(C$2:C25,,,ROW(INDIRECT("1:25")),1)))>=2000,),0)
Remember both the formulas are Array Formulas which require a special key stroke Ctrl+Shift+Enter instead of Enter alone.

Formula for sales volume in 'N' period

My report layout is linked to a stored procedure in SQL, which returns data regarding inventory from our SAP B1 system. This identifies appropriate Minimum and Maximum stock holding values.
I draw in several fields into calculated fields. A pair of parameter fields input a 'no. of periods' value (such as 6 months) and specify an item group from the list in SAP. I currently get the sum total of items invoiced out, minus the sum total of credited in all the way back to record one in the DB.
I need to be able to get a new sales total which is sum total of items invoiced out minus sum total of credits in, divided by the no. of periods value to get a new average sales value. but I simply can't think about how to go about creating the field.
How can I get the desired behavior?

Resources