SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


MultiValue parameter is only returning one selection when two or more specific selections are made


MultiValue parameter is only returning one selection when two or more specific selections are made

Author
Message
grantbanjo
grantbanjo
SSC-Enthusiastic
SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)

Group: General Forum Members
Points: 118 Visits: 170
Hello,
I am using SSRS in SQL Server 2008 R2 and I have a simple report set up with a single parameter that is set up to return multiple values in a drop-down. There are a total of four options from which to select. When the top option "Select All" is made it correctly returns all of the results. When a single selection is made among any of the four options, it correctly returns results. When I uncheck "Select All" and select the four Division options specifically, it correctly returns the results for all four.

However, the problem comes when two or three specific selections are made from the four, regardless of which ones they are, then it only returns the results associated with the top-most selection made and fails to return the results for the last selection(s) made.

The parameter @DivisionName is populated from a query applying a DISTINCT based on a field called DivisionName. This query is set up in a dataset called Divisions. This is then being applied in a second dataset from which the results are obtained called WeekOutlook. It also contains a field called RegionName and associated with that RegionName field I have added a filter with the following:

Expression is "[DivisionName]
Operator is "In"
Value is [@DivisionName]

The parameter properties for @DivisionName have under the
- General Tab:
"Allow multiple values" checked, Name and Prompt are populated, Visible is selected
- Available Values Tab:
"Get values from a query" is selected, Dataset = Divisions, Value field = DivisionName, Lable field = DivisionName
- Default Values Tab:
"Get values from a query" is selected, Dataset = Divisions, Value field = DivisionName
- Advanced Tab:
"Automatically determine when to refresh" is selected and "Notify...." is checked.

I've tried modifying the query associated with the WeekOutlook dataset to include under the WHERE clause "DivisionName in ([@DivisionName])", but that made no difference and I removed it. I'm trying to avoid doing too much special SQL coding so that it will more intuitive for others less familiar with SQL to modify the reports in the future using the SSRS GUI.

If it will assist, listed below is the query for the Divisions and WeekOutlook datasets:

Divisions:
SELECT DISTINCT d.DivisionName
FROM Tasks AS t INNER JOIN
Division AS d ON t.fk_DivisionID = d.DivisionID INNER JOIN
Region AS r ON t.fk_RegionID = r.RegionID INNER JOIN
Projects AS p ON t.fk_ProjectID = p.ProjectID INNER JOIN
Iterations AS i ON t.fk_IterationID = i.IterationID
WHERE (t.BaselineFinish BETWEEN GETDATE() - DATEPART(dw, GETDATE() - 1) + 1 AND GETDATE() + (7 - DATEPART(dw, GETDATE() - 1)))
ORDER BY d.DivisionName



WeekOutlook:
SELECT     t.ID, t.UniqueID, t.Name, t.Active, d.DivisionName, r.RegionName, t.ScheduleByElement, p.Project_ID, i.Iteration_ID, t.WatchStatus, t.ActualStart, t.ActualFinish, 
t.StartDate, t.FinishDate, t.BaselineStart, t.BaselineFinish, t.Baseline1Start, t.Baseline1Finish, t.Baseline2Start, t.Baseline2Finish, t.Baseline3Start, t.Baseline3Finish,
t.PercentComplete, t.Duration, t.OutlineLevel, t.WBS, t.Milestone, t.Rollup, t.Notes, t.AugmentPhase, t.DeploymentNotes, t.CAPMPriority, t.ResourceNames,
t.ResourceGroup, t.Reason
FROM Tasks AS t INNER JOIN
Division AS d ON t.fk_DivisionID = d.DivisionID INNER JOIN
Region AS r ON t.fk_RegionID = r.RegionID INNER JOIN
Projects AS p ON t.fk_ProjectID = p.ProjectID INNER JOIN
Iterations AS i ON t.fk_IterationID = i.IterationID
WHERE (t.BaselineFinish BETWEEN GETDATE() - DATEPART(dw, GETDATE() - 1) + 1 AND GETDATE() + (7 - DATEPART(dw, GETDATE() - 1)))
ORDER BY d.DivisionName, r.RegionName, p.Project_ID, i.IterationID, t.BaselineFinish




I first checked the forums but could not find an issue quite like this one. Hopefully, I've provided enough information. Thanks in advance for your assistance.
grantbanjo
grantbanjo
SSC-Enthusiastic
SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)

Group: General Forum Members
Points: 118 Visits: 170
Typing up the details of my issue helped me to see and resolve the problem. The page break was not set up correctly. Now a new page break is taking place as it should following the reults for each division. This was not showing up before.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search