Hello,
I am creating a profit and loss statement in SQL Server reporting Services.
This single report creates a one page P&L for each loction in the company.
Some of the calculations are based on the Sales of each location (i.e.
percentages etc.). I'd like to reference the sales total for the each
location in one of the groupings of the report. The problem is, when I do
"Sum(Sales)" it doesn't sum the sales figures for the location, but only the
grouping I'm in. Is there a way to do this expression so it sums the Sales
figure for the whole location? If not, is there a way to reference a
particular textbox on the report?
Any help or direction would be greatly appreciated.
Thanks!
RickHey Rico,
Try Using:
RunningValue(Fields!Sales.Value, Sum,"LocationGroupName")
Michael C
"Rico" wrote:
> Hello,
> I am creating a profit and loss statement in SQL Server reporting Services.
> This single report creates a one page P&L for each loction in the company.
> Some of the calculations are based on the Sales of each location (i.e.
> percentages etc.). I'd like to reference the sales total for the each
> location in one of the groupings of the report. The problem is, when I do
> "Sum(Sales)" it doesn't sum the sales figures for the location, but only the
> grouping I'm in. Is there a way to do this expression so it sums the Sales
> figure for the whole location? If not, is there a way to reference a
> particular textbox on the report?
> Any help or direction would be greatly appreciated.
> Thanks!
> Rick
>
>|||Thanks!
"Michael C" <MichaelC@.discussions.microsoft.com> wrote in message
news:1F8BB7D0-3298-4A46-BB9D-389C26386523@.microsoft.com...
> Hey Rico,
> Try Using:
> RunningValue(Fields!Sales.Value, Sum,"LocationGroupName")
> Michael C
> "Rico" wrote:
>> Hello,
>> I am creating a profit and loss statement in SQL Server reporting
>> Services.
>> This single report creates a one page P&L for each loction in the
>> company.
>> Some of the calculations are based on the Sales of each location (i.e.
>> percentages etc.). I'd like to reference the sales total for the each
>> location in one of the groupings of the report. The problem is, when I
>> do
>> "Sum(Sales)" it doesn't sum the sales figures for the location, but only
>> the
>> grouping I'm in. Is there a way to do this expression so it sums the
>> Sales
>> figure for the whole location? If not, is there a way to reference a
>> particular textbox on the report?
>> Any help or direction would be greatly appreciated.
>> Thanks!
>> Rick
>>
Showing posts with label single. Show all posts
Showing posts with label single. Show all posts
Tuesday, March 20, 2012
Saturday, February 25, 2012
Reducing 5 values to 1 value
I am trying to take values that exist in a single column and create a column
elsewhere that contains comma separated values of that dataset.
The '5' is arbitrary...
For example,
Greg
John
Bill
Carol
Judy
Julie
Would look like
Greg, John, Bill, Carol, Judy, Julie
Appreciate in advance any thoughts....
GregA way, maybe not the best way
DECLARE @.name varchar(512)
DECLARE @.list varchar(512)
SET @.name = ''
SET @.list = ''
DECLARE names_cursor STATIC FORWARD_ONLY
FOR
SELECT DISTINCT [name] FROM [YourTable]
OPEN names_cursor
FETCH NEXT FROM names_cursor INTO @.name
WHILE (@.@.FETCH_STATUS = 0)
BEGIN
SET @.list = @.list + @.name
FETCH NEXT FROM names_cursor INTO @.name
END
INSERT INTO [OtherTable] VALUES (@.list)
CLOSE names_cursor
DEALLOCATE names_cursor
Look at
http://www.microsoft.com/technet/co...r />
931d-e02a
cbb88505
for a trigger that I wrote that would keep those two tables syncrhonized.
"Greg" wrote:
> I am trying to take values that exist in a single column and create a colu
mn
> elsewhere that contains comma separated values of that dataset.
> The '5' is arbitrary...
> For example,
> Greg
> John
> Bill
> Carol
> Judy
> Julie
> Would look like
> Greg, John, Bill, Carol, Judy, Julie
> Appreciate in advance any thoughts....
> Greg
>|||Ahh I asked this one the other day...
See http://www.aspfaq.com/show.asp?id=2529
Or see this post..
http://groups.google.co.uk/group/mi...7f3f3d7de2dd4fa
Barry
elsewhere that contains comma separated values of that dataset.
The '5' is arbitrary...
For example,
Greg
John
Bill
Carol
Judy
Julie
Would look like
Greg, John, Bill, Carol, Judy, Julie
Appreciate in advance any thoughts....
GregA way, maybe not the best way
DECLARE @.name varchar(512)
DECLARE @.list varchar(512)
SET @.name = ''
SET @.list = ''
DECLARE names_cursor STATIC FORWARD_ONLY
FOR
SELECT DISTINCT [name] FROM [YourTable]
OPEN names_cursor
FETCH NEXT FROM names_cursor INTO @.name
WHILE (@.@.FETCH_STATUS = 0)
BEGIN
SET @.list = @.list + @.name
FETCH NEXT FROM names_cursor INTO @.name
END
INSERT INTO [OtherTable] VALUES (@.list)
CLOSE names_cursor
DEALLOCATE names_cursor
Look at
http://www.microsoft.com/technet/co...r />
931d-e02a
cbb88505
for a trigger that I wrote that would keep those two tables syncrhonized.
"Greg" wrote:
> I am trying to take values that exist in a single column and create a colu
mn
> elsewhere that contains comma separated values of that dataset.
> The '5' is arbitrary...
> For example,
> Greg
> John
> Bill
> Carol
> Judy
> Julie
> Would look like
> Greg, John, Bill, Carol, Judy, Julie
> Appreciate in advance any thoughts....
> Greg
>|||Ahh I asked this one the other day...
See http://www.aspfaq.com/show.asp?id=2529
Or see this post..
http://groups.google.co.uk/group/mi...7f3f3d7de2dd4fa
Barry
Subscribe to:
Posts (Atom)