Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SSRS Return Data from One Dataset where it does not exist in another

Posted on 2013-11-18
3
Medium Priority
?
2,594 Views
Last Modified: 2013-11-23
Hi, I am using Report Builder 3 on SQL 2008 and am wondering if it is possible to return values in one dataset based on whether the value is present in another dataset.

For example, my first dataset is the one my Tablix is based on and has a list of property references.

My second dataset just pulls through a list of property references that have a certain charge against them.

I don't want to see the properties in my first dataset if they exist in the second dataset?

Many thanks in Advance.
0
Comment
Question by:deborahhowson00
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Expert Comment

by:Tony303
ID: 39658604
Does the Query feeding the first dataset have the field that determines that a charge is against the property?

I would just filter your dataset that feeds the Tablix.

OR You could change the first query to include a nested query that excludes the properties with a charge.

Like this.

SELECT *
FROM yourfirstdatasetTable
WHERE ID NOT IN  (SELECT ID FROM yourseconddatasetTable WHERE ChargeOnProperty = 1)

Open in new window

0
 

Accepted Solution

by:
deborahhowson00 earned 0 total points
ID: 39658637
The trouble was that I couldn't start using SQL as I'm training 'non IT' users in how to create reports so had to do it using the GUI without using SQL statements that haven't been built in the Query Designer.  I have found the answer to my problem by filtering the TABLIX where the Property Reference <> (LOOKUP the Property Ref from my second dataset).  

You can't filter a dataset based on another dataset, but you can filter a tablix based on a lookup from another dataset which I didn't realise at the time.

I initially tried using a parameter to select the 'default values' (ie property refs) from my second dataset and then basing the first dataset on that parameter but the report kept timing out.  This method has worked for other smaller reports though!

Thanks anyway, cheers.
0
 

Author Closing Comment

by:deborahhowson00
ID: 39671161
I figured out how to do it myself.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question