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

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Lookup function

Author  Topic 

tech2
Yak Posting Veteran

51 Posts

Posted - 2013-06-13 : 11:13:41
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

52326 Posts

Posted - 2013-06-14 : 00:51:10
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

51 Posts

Posted - 2013-06-14 : 15:05:42
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

52326 Posts

Posted - 2013-06-14 : 15:14:05
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
   

- Advertisement -