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)
 countif or lookup

Author  Topic 

tech2
Yak Posting Veteran

51 Posts

Posted - 2013-11-06 : 14:44:12
I'm trying to use lookup or an if statement to reference another item number. for example:

I've got a table with part number 'WidgetB' and the upper level number is 'MasterWidget'.

How can I instruct lookup or the if statement to indicate the count on 'WidgetB' whenever the report picks up 'MasterWidget'.

I hope this not to confusing. Basicly I'm trying to reference 'MasterWidget' to allocate against 'WidgetB'.

Report Builder 3.0 R2 2008

Thanks,

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-07 : 03:26:13
so is it always just one level relatioship or can it go multiple levels? like MasterWidget->WidgetB-> xxxxxx. in that do you want to include count recursively until last level?

------------------------------------------------------------------------------------------------------
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-11-07 : 09:01:28
Only one relationship / level - Below are the Column Names and one line of data.

ItemNumber - QOH - Alloc. - AVL.

WidgetB - 2 - <EXP> - 1

the expression would look at the 'ItemNumber' field in another dataset to lookup any occurence of 'MasterWidget' and plance in the 'Alloc' column of 'WidgetB'. From there I can recalculate the 'AVL'.

thanks,
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-07 : 09:08:21
is <EXP> an expression stored as a column value? is your attempt to execute it and get the resulting value?

------------------------------------------------------------------------------------------------------
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-11-07 : 11:56:00
yes, the <EXP> would be stored in the new added 'Alloc' column.

My problem is; All my expressions have failed. Below is a Lookup I'm performing on another field and it's working. I just don't know how to include the 'if' statement or expressiong to convert my 'Widget' senerio.

=LookupSet(Fields!ItemNumber.Value, Fields!ItemNumber.Value, Fields!ItemNumber.Value,"DataSet15").Length
Go to Top of Page
   

- Advertisement -