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


SSRS: How to make two tables have the same number of row


SSRS: How to make two tables have the same number of row

Author
Message
enestijr
enestijr
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 20
hi experts

I have the following

dataset1(MDX) (always has more rows than dataset2)
dataset2(MDX)

tablix1(source is dataset1)
tablix2(source is dataset2)

what i need to accomplish is to have same number of rows for both tablix1 and tablix2
for example: if the dataset1 gives 27 rows and dataset2 gives 14 rows, i wanted to have 27 rows for tablix1 and also 27 rows for tablix2(having 14 rows filled with the result set of dataset2 and 13 empty rows).

is therer any way to add empty rows to a table ? ( I use SSRS 2008 )

Thank you in advance.

Nestor
SatishChandra_SQL
SatishChandra_SQL
Valued Member
Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)

Group: General Forum Members
Points: 72 Visits: 359
Hi Nestor,

I am not sure of the actual requirement and costraints around your tables, but i think you can try .....

Take the differnece of Table rows with help of a variable/function.

Create a stored procedure and loop the empty insert ('') command as many times as variable.. where variable > 0.
I think then you can have the equal number or rows in both the tables...



Thanks
- Satish
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