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


Running Sum per row in Report


Running Sum per row in Report

Author
Message
dbman
dbman
Say Hey Kid
Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)

Group: General Forum Members
Points: 677 Visits: 1537
Hello I am having a few issues with a Matrix report I am developing:

Firstly I have two queries:

One:

 SELECT     Sales_Export.Country, Sales_Export.AccountNumber, InstrastatCustomers.AccountName, Sales_Export.ContractCode, Sales_Export.SalesValue, 
Sales_Export.SalesDate
FROM Sales_Export INNER JOIN
InstrastatCustomers ON InstrastatCustomers.AccountNumber = Sales_Export.AccountNumber
WHERE (Sales_Export.SalesDate BETWEEN @StartDate AND @EndDate)
GROUP BY Sales_Export.Country, Sales_Export.AccountNumber, InstrastatCustomers.AccountName, Sales_Export.ContractCode, Sales_Export.SalesValue,
Sales_Export.SalesDate
ORDER BY Sales_Export.SalesDate




I also have another query called Running Sum:

Two:



SELECT SUM(SalesValue) AS SalesValue, AccountNumber
FROM Sales_Export
GROUP BY AccountNumber





My matrix report is as follows:

Country, AccountName, Account, ContractCode, SalesValue, MTD
Sum(SalesValue)





The matrix report produces sales of each individual day. In my month to date column I would like the sales for all the days added up in this column. I attempted to create an expression but this is summing the whole column.

=RunningValue(Fields!SalesValue.Value,Sum, "DailyExportSales")



Does anyone know how i can achieve the sum for each day in that column.
dbman
dbman
Say Hey Kid
Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)Say Hey Kid (677 reputation)

Group: General Forum Members
Points: 677 Visits: 1537
Fixed!
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