Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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)
 Lookup function
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tech2
Yak Posting Veteran

50 Posts

Posted - 06/13/2013 :  11:13:41  Show Profile  Reply with Quote
Using SSRS 2008 R2

Why does the first record always return a (1) when the lookup fuction below is executed. All other records are correct.

=Lookup(Fields!WarehouseCode.Value, Fields!WarehouseCode.Value, Fields!QuantityOnHand.Value,"DataSet2")

thx,

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 06/14/2013 :  00:51:10  Show Profile  Reply with Quote
cant answer without seeing the dataset. May be QuantityOnhand was 1 for it.

Please keep in mind that in case lookup matches more than one record in second dataset only first value will be returned

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

tech2
Yak Posting Veteran

50 Posts

Posted - 06/14/2013 :  15:05:42  Show Profile  Reply with Quote
Thanks for the response

Qty On Hand is not (1)

Thanks again for your effort.

quote:
Originally posted by visakh16

cant answer without seeing the dataset. May be QuantityOnhand was 1 for it.

Please keep in mind that in case lookup matches more than one record in second dataset only first value will be returned

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 06/14/2013 :  15:14:05  Show Profile  Reply with Quote
post sample datasets for us to work on. specify what you're trying to lookup against

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next 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.04 seconds. Powered By: Snitz Forums 2000