Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Something like a running total... Expand / Collapse
Author
Message
Posted Monday, November 9, 2009 9:13 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 7:32 AM
Points: 93, Visits: 192
Hello!

I am tracking our company's inventory in a SSRS 2008 Tablix report. I am displaying the inventory for each day, at the end of the Month I need to display the Month inventory...basically the inventory on the last day of the month.

Select invDate, Branch, Month(invdate) as Month_,
InvBalance
From DailyInventory

Matrix row group=Branch
column group=Month_, invDate

Post #815869
Posted Monday, November 9, 2009 9:39 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, December 15, 2014 8:18 AM
Points: 1,320, Visits: 1,013
Could you do a sum on the values where the invdate equals the max invdate within the month grouping, something along the lines of,

SUM(IIF(invdate = MAX(invdate,"Month"),InvBalance,0)
Post #815904
Posted Monday, November 9, 2009 2:31 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 7:32 AM
Points: 93, Visits: 192
That's not working, I am trying to do this in a Matrix so it is not recognizing that "cell" as having any data
Post #816139
Posted Monday, November 9, 2009 2:45 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 7:32 AM
Points: 93, Visits: 192
We are definitely on the right track here, I need to find the value for the max(date) and pass it to the "Total" cell...now how to do this???
Post #816152
Posted Tuesday, November 10, 2009 11:50 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 7:32 AM
Points: 93, Visits: 192
I figured out how to do it for the weekly total rows...

=iif(InScope("Date2"), sum(Fields!Sales.Value), last(Fields!Sales.Value))

Now the conundrum lies in trying to total the total columns correctly
Post #816720
Posted Friday, July 16, 2010 5:33 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 7:27 AM
Points: 35,769, Visits: 32,437
marty.seed (11/10/2009)
I figured out how to do it for the weekly total rows...

=iif(InScope("Date2"), sum(Fields!Sales.Value), last(Fields!Sales.Value))

Now the conundrum lies in trying to total the total columns correctly


Hi Marty,

Did you ever get this sorted out?


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #954269
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse