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)
 Lookup function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tech2
Starting Member

32 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
52249 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
Starting Member

32 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
52249 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  
 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.06 seconds. Powered By: Snitz Forums 2000