PC Review


Reply
Thread Tools Rate Thread

How do I filter a child table through its parent?

 
 
=?Utf-8?B?Q2Fyb2xpbmE=?=
Guest
Posts: n/a
 
      27th Jan 2005
Hi all!

I am trying to apply a filter to a table in a dataset using criteria from a
parent table, but I have no luck so far.

Having a dataset with tables for Customers and Orders, and a relation
between them, I wish to find the highest order for customers in a specific
region. Creating a view for Customers filtering them to only display
Customers in Region='A' is no problem, but as I try accessing Orders, it is
not filtered and so I have no way of finding the most expensive order for the
region 'A'. Just using the same criteria on the dataview for Orders does not
work, neither "Region='A'" nor "Customers.Region='A'" can be applied to the
Orders table.

I am actually not interested in displaying this information, I need to use
values from the filtered version of Orders for extensive calculations and
aggregations, so attaching my dataset/tables/views to any userinterface
components won't help.

Any ideas greatly appreciated!

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QXNoaXNoIEtlbG8=?=
Guest
Posts: n/a
 
      27th Jan 2005
Carolina,

Why you fighting with the records with the Dataset objetc, it might effect
the performance get all the Data gather through a function and manupilcations
done in that, using a repeater for each row of Customer and Orders. This will
help you in migrating the data hencforth.

Thanks,
Ashish Kelo

"Carolina" wrote:

> Hi all!
>
> I am trying to apply a filter to a table in a dataset using criteria from a
> parent table, but I have no luck so far.
>
> Having a dataset with tables for Customers and Orders, and a relation
> between them, I wish to find the highest order for customers in a specific
> region. Creating a view for Customers filtering them to only display
> Customers in Region='A' is no problem, but as I try accessing Orders, it is
> not filtered and so I have no way of finding the most expensive order for the
> region 'A'. Just using the same criteria on the dataview for Orders does not
> work, neither "Region='A'" nor "Customers.Region='A'" can be applied to the
> Orders table.
>
> I am actually not interested in displaying this information, I need to use
> values from the filtered version of Orders for extensive calculations and
> aggregations, so attaching my dataset/tables/views to any userinterface
> components won't help.
>
> Any ideas greatly appreciated!
>

 
Reply With Quote
 
Sahil Malik
Guest
Posts: n/a
 
      28th Jan 2005
Carolina,

What are your table structures?

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik


"Carolina" <(E-Mail Removed)> wrote in message
news:09ADD969-A683-4A85-A193-(E-Mail Removed)...
> Hi all!
>
> I am trying to apply a filter to a table in a dataset using criteria from
> a
> parent table, but I have no luck so far.
>
> Having a dataset with tables for Customers and Orders, and a relation
> between them, I wish to find the highest order for customers in a specific
> region. Creating a view for Customers filtering them to only display
> Customers in Region='A' is no problem, but as I try accessing Orders, it
> is
> not filtered and so I have no way of finding the most expensive order for
> the
> region 'A'. Just using the same criteria on the dataview for Orders does
> not
> work, neither "Region='A'" nor "Customers.Region='A'" can be applied to
> the
> Orders table.
>
> I am actually not interested in displaying this information, I need to use
> values from the filtered version of Orders for extensive calculations and
> aggregations, so attaching my dataset/tables/views to any userinterface
> components won't help.
>
> Any ideas greatly appreciated!
>



 
Reply With Quote
 
=?Utf-8?B?Q2Fyb2xpbmE=?=
Guest
Posts: n/a
 
      28th Jan 2005
Hi Ashish!

Thank you for your answer.

I should have mentioned that I am designing a windows based application that
will be running on clients with local datasources (MSDE). We work with a
group of local customers and the user will be able to retreive a number of
customers with orders from the local database, and we need to keep this in a
relational structure as we manipulate the data. Furthermore, the user must be
able to select (by manually ctrl+click marking) an arbitrary subset of
customers, and from this subset generate a number of different reports.
Reports include grouped tables, historical analysies and so on. I see no
other way than doing calculations for these reports "on the fly".

I do have a dedicated component doing the grouping and calculations, and I
aim to minimize iterations and repeteteive procedure calls as much as
possible. I am not sure what you mean with using a repeater - could you
explain in more detail how I could apply it to my scenario?


"Ashish Kelo" wrote:

> Carolina,
>
> Why you fighting with the records with the Dataset objetc, it might effect
> the performance get all the Data gather through a function and manupilcations
> done in that, using a repeater for each row of Customer and Orders. This will
> help you in migrating the data hencforth.
>
> Thanks,
> Ashish Kelo
>
> "Carolina" wrote:
>
> > Hi all!
> >
> > I am trying to apply a filter to a table in a dataset using criteria from a
> > parent table, but I have no luck so far.
> >
> > Having a dataset with tables for Customers and Orders, and a relation
> > between them, I wish to find the highest order for customers in a specific
> > region. Creating a view for Customers filtering them to only display
> > Customers in Region='A' is no problem, but as I try accessing Orders, it is
> > not filtered and so I have no way of finding the most expensive order for the
> > region 'A'. Just using the same criteria on the dataview for Orders does not
> > work, neither "Region='A'" nor "Customers.Region='A'" can be applied to the
> > Orders table.
> >
> > I am actually not interested in displaying this information, I need to use
> > values from the filtered version of Orders for extensive calculations and
> > aggregations, so attaching my dataset/tables/views to any userinterface
> > components won't help.
> >
> > Any ideas greatly appreciated!
> >

 
Reply With Quote
 
=?Utf-8?B?Q2Fyb2xpbmE=?=
Guest
Posts: n/a
 
      28th Jan 2005
Customers are typed with one reference table, one-to-many relation exists to
Orders. Orders are typed with two different reference tables (source and
category). All reference tables are loaded in the dataset and relations are
established. I am using a typed dataset.

"Sahil Malik" wrote:

> Carolina,
>
> What are your table structures?
>
> - Sahil Malik
> http://dotnetjunkies.com/weblog/sahilmalik
>
>
> "Carolina" <(E-Mail Removed)> wrote in message
> news:09ADD969-A683-4A85-A193-(E-Mail Removed)...
> > Hi all!
> >
> > I am trying to apply a filter to a table in a dataset using criteria from
> > a
> > parent table, but I have no luck so far.
> >
> > Having a dataset with tables for Customers and Orders, and a relation
> > between them, I wish to find the highest order for customers in a specific
> > region. Creating a view for Customers filtering them to only display
> > Customers in Region='A' is no problem, but as I try accessing Orders, it
> > is
> > not filtered and so I have no way of finding the most expensive order for
> > the
> > region 'A'. Just using the same criteria on the dataview for Orders does
> > not
> > work, neither "Region='A'" nor "Customers.Region='A'" can be applied to
> > the
> > Orders table.
> >
> > I am actually not interested in displaying this information, I need to use
> > values from the filtered version of Orders for extensive calculations and
> > aggregations, so attaching my dataset/tables/views to any userinterface
> > components won't help.
> >
> > Any ideas greatly appreciated!
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?Q2Fyb2xpbmE=?=
Guest
Posts: n/a
 
      28th Jan 2005
Customers has a "typetable" (customer group), and a one-to-many relation to
Orders. Orders has two typetables (source and category). All tables are
loaded in the dataset and relations established.

"Sahil Malik" wrote:

> Carolina,
>
> What are your table structures?
>
> - Sahil Malik
> http://dotnetjunkies.com/weblog/sahilmalik
>
>
> "Carolina" <(E-Mail Removed)> wrote in message
> news:09ADD969-A683-4A85-A193-(E-Mail Removed)...
> > Hi all!
> >
> > I am trying to apply a filter to a table in a dataset using criteria from
> > a
> > parent table, but I have no luck so far.
> >
> > Having a dataset with tables for Customers and Orders, and a relation
> > between them, I wish to find the highest order for customers in a specific
> > region. Creating a view for Customers filtering them to only display
> > Customers in Region='A' is no problem, but as I try accessing Orders, it
> > is
> > not filtered and so I have no way of finding the most expensive order for
> > the
> > region 'A'. Just using the same criteria on the dataview for Orders does
> > not
> > work, neither "Region='A'" nor "Customers.Region='A'" can be applied to
> > the
> > Orders table.
> >
> > I am actually not interested in displaying this information, I need to use
> > values from the filtered version of Orders for extensive calculations and
> > aggregations, so attaching my dataset/tables/views to any userinterface
> > components won't help.
> >
> > Any ideas greatly appreciated!
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?Q2Fyb2xpbmE=?=
Guest
Posts: n/a
 
      28th Jan 2005
I managed to solve this with help from a colleague at work!

The solution that worked for me is brilliantly simple: filtering on parent
criteria can be done using "parent.field" on the child's
defaultview.rowfilter property.

For example: myds.Orders.DefaultView.RowFilter = "parent.City='Stockholm'"

Thank you Ashish and Sahil for trying to help me!

"Carolina" wrote:

> Hi all!
>
> I am trying to apply a filter to a table in a dataset using criteria from a
> parent table, but I have no luck so far.
>
> Having a dataset with tables for Customers and Orders, and a relation
> between them, I wish to find the highest order for customers in a specific
> region. Creating a view for Customers filtering them to only display
> Customers in Region='A' is no problem, but as I try accessing Orders, it is
> not filtered and so I have no way of finding the most expensive order for the
> region 'A'. Just using the same criteria on the dataview for Orders does not
> work, neither "Region='A'" nor "Customers.Region='A'" can be applied to the
> Orders table.
>
> I am actually not interested in displaying this information, I need to use
> values from the filtered version of Orders for extensive calculations and
> aggregations, so attaching my dataset/tables/views to any userinterface
> components won't help.
>
> Any ideas greatly appreciated!
>

 
Reply With Quote
 
Sahil Malik
Guest
Posts: n/a
 
      28th Jan 2005
Slightly late to the party, but I am glad you got it to work.

I've been a bit inactive here lately, but I will come back soon as my
daytime job lets me to .. LOL

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik



"Carolina" <(E-Mail Removed)> wrote in message
news:1F8F5D3B-79F7-4605-BA3F-(E-Mail Removed)...
> I managed to solve this with help from a colleague at work!
>
> The solution that worked for me is brilliantly simple: filtering on parent
> criteria can be done using "parent.field" on the child's
> defaultview.rowfilter property.
>
> For example: myds.Orders.DefaultView.RowFilter = "parent.City='Stockholm'"
>
> Thank you Ashish and Sahil for trying to help me!
>
> "Carolina" wrote:
>
> > Hi all!
> >
> > I am trying to apply a filter to a table in a dataset using criteria

from a
> > parent table, but I have no luck so far.
> >
> > Having a dataset with tables for Customers and Orders, and a relation
> > between them, I wish to find the highest order for customers in a

specific
> > region. Creating a view for Customers filtering them to only display
> > Customers in Region='A' is no problem, but as I try accessing Orders, it

is
> > not filtered and so I have no way of finding the most expensive order

for the
> > region 'A'. Just using the same criteria on the dataview for Orders does

not
> > work, neither "Region='A'" nor "Customers.Region='A'" can be applied to

the
> > Orders table.
> >
> > I am actually not interested in displaying this information, I need to

use
> > values from the filtered version of Orders for extensive calculations

and
> > aggregations, so attaching my dataset/tables/views to any userinterface
> > components won't help.
> >
> > Any ideas greatly appreciated!
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I remove parent-child relationships in the parent table? Pat Dools Microsoft Access 3 1st Apr 2009 03:19 AM
Searching for parent in child-parent table takatam Microsoft Access Queries 5 15th Aug 2008 03:41 PM
How to apply filtering to a child table in a parent/child grid johannblake@yahoo.com Microsoft ADO .NET 1 19th Oct 2005 03:00 PM
Unknown filter or parent/child relationship EJO Microsoft Access 1 8th Aug 2005 08:33 PM
Filter on Parent-child relation?? mathieu Microsoft ADO .NET 1 9th Jan 2005 08:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:07 AM.