Sunday, February 12, 2012

Business Intelligence Report Parameter Prompt Multi

I have my 2 datasets and my parameter set up to display building to select from. My issue is I get multiple values in the Select Value Prompt. It will pull the correct data I just want to clean up the Select Value Prompt.

Example:

Building 1

Building 1

Building 1

Building 2

Building 2

Dataset 1:

Select *

From Table

Dataset 2:

SELECT *

From Table

WHERE (Table.Building = @.Building)

ORDER BY Client.ctg

I'm assuming that you're using Dataset1 to populate the parameter. If so, try using the keyword DISTINCT in your SQL query for Dataset1.

SELECT DISTINCT
BuildingNameField
FROM Table (NoLock)
ORDER BY BuildingNameField

|||I can't use the distinct because it will cut down my data and not give me an accurate query. Unless the is a way to do it that I am not aware of. What is the (nolock)?|||What had to do is make a 3rd dataset in the report, w/ just the select distinct statement in it and then, change the available values dataset to the one that is just the select distinct.|||

The "nolock" (also written as "with nolock") insures that the table isn't locked while running the query. I always use this as a general practice when I'm running a query that really doesn't need to lock the table.

About 99.9% of the time, I always create a seperate dataset for parameters. This way, if you need to make changes to the dataset, you don't have to worry about screwing up data for something else.

Thanks,

Micheal

No comments:

Post a Comment