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 on a multi-value parameter
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gbritton
Flowing Fount of Yak Knowledge

2780 Posts

Posted - 11/15/2013 :  12:25:28  Show Profile  Reply with Quote
I have multi-value report parameter called MultiValue. When the report is called from a parent report, MultiValue can contain a list of values from the parent's dataset or a single value, "*". The idea is that, when the linked report runs, it filters the results basded on the contents of MuliValue. However, there are two choices:

1. When MultiValue contains a list of values from the dataset, it filters on those values
2. When the MultiValue contains "*", it returns all rows from the dataset.

Ideally, I want something like:

if Field!datasetField in MultiValue or MultiValue(0) = "*"
then return the row

I can't find an easy way to do this in an expression.

First of all, multi-value report parameters do not seem to have Contains properties or anything similar.

Second, the Lookup function doesn't seem to work if the "dataset" is a multi-value report parameter.

So...what's another way to tackle this problem?

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 11/16/2013 :  01:20:19  Show Profile  Reply with Quote
something like below should be filter expression

=Fields!YourField.value In =IIF(Parameters!MultivalueParam.value(0)="*",Fields!YourField.value,Join(Parameters!MultivalueParam.value))

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

gbritton
Flowing Fount of Yak Knowledge

2780 Posts

Posted - 11/18/2013 :  11:46:06  Show Profile  Reply with Quote
quote:
Originally posted by visakh16

something like below should be filter expression

=Fields!YourField.value In =IIF(Parameters!MultivalueParam.value(0)="*",Fields!YourField.value,Join(Parameters!MultivalueParam.value))




Cool!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 11/19/2013 :  01:41:13  Show Profile  Reply with Quote
welcome

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