Quantcast
Channel: SQL Server Reporting Services, Power View Forum
Viewing all articles
Browse latest Browse all 4035

merge data from multiple rows into one in SSRS

$
0
0

Hi everyone-

I am new to SSRS and MDX and am struggling with a problem.

I have a dataset in SSRS 2008 R2 and here is my requirement.

I have dimensions like Country, Sales ID, Region, Sales From Date, Sales To Date, Count, Amount. The rows of my dataset return values like these

Country,   Sales ID,       Region,          Sales From Date,        Sales To Date,      Count,   Amount

US              001             Midwest          Aug 17, 2011               Aug 19, 2011                  1            50

US              001             Midwest          Aug 20,2011                 Aug 25, 2011                  1             25

Note: If you add the rows the count becomes 2

If the country, sales id, region are the same AND if the SalesFromDate of second row is the consecutive day of the SalesToDate(i.e. SalesToDate +1 day) then, it should return only one row and add the total up

So my dataset should return just one row,

US              001             Midwest          Aug 17, 2011               Aug 19, 2011                  1            75

Alternatively, if I made the count for the second row 0 that solution is acceptable too.

i.e.

US              001             Midwest          Aug 17, 2011               Aug 19, 2011                  1            50

US              001             Midwest          Aug 20,2011                 Aug 25, 2011                 0            25

I am essentially interested in keeping the count as 1 and not 2.

Any help will be greatly appreciated.

If this can be implementated at cube level, then that's fine too. Please note that all these rows are not of the same dimension. i.e. there is no hierarchy.

Thanks 

 


Viewing all articles
Browse latest Browse all 4035