SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Assignt to right value to the corresponding rows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Vadz
Starting Member

Fiji
11 Posts

Posted - 12/13/2012 :  15:15:30  Show Profile  Reply with Quote
if my table is like this in my database

Student Staff children
34 104 playing
34 104 playing
34 104 rugby
34 104 soccer
34 104 playing

i want the value 34 to assign only to playing, if rugby or soccer it should be 0 or empty set and staff(1024) to assign only to rugby and soccer.i was wondering can i do this in my expression if i have =Fields!XXX.value. if not how can i write this in query.i query and display my tables as this.which is fine.and value of 34 and 104 a constant value.

my final table result i want to be like this

Student Staff children
34 0 playing
34 0 playing
0 104 rugby
0 104 soccer
34 104 playing

thanks in advance

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 12/14/2012 :  03:18:39  Show Profile  Reply with Quote
Use IIF
=IIF(Fields!children.value = "playing",Fields!Student.value,0)
for student and
=IIF(Fields!children.value = "rugby" Or Fields!children.value = "soccer",Fields!Staff.value,0)
for Staff

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000