locked
How to filter data in one list based on the data in another list sharepoint portal using two filter criteria RRS feed

  • Question

  • Hi,

    Hi,

     

    I created two lists in SharePoint portal.Then, i created an aspx page in that sharepoint site using Microsoft Office SharePoint designer 2007  and  included two data view web parts one for first list and second for second list.Now, i need to filter data in second web part(data in second list) based on the data selected in the first list(first data view).

    I need to use two filter conditions like (first list.field1>= second list.field2 and first list.field2<= second list.field3).

     

    Kindly let me know how to perform this filter.

     

    Thanks in advance


    Selvarani
    Tuesday, September 27, 2011 12:04 PM

Answers

  • Hi Selvarani,

     

    To achieve this, you can set second list data view web part to get parameter from first list, then filter the second list based on the parameters get from first list, try the following steps:

     

    1.       Insert two web part zone, then insert data views for first list and second list.

    2.       For the second list data view web part, in Common Data View Tasks, choose Web Part Connections.

    3.       Set the Web Part Connections as below:

    a. choose the action on the source web part to use for this connection: Get Parameter From

    b. choose Connect to a Web Part on this page

    c. set choose the columns in the source web part which match the input parameters for the target web part: column in first list: field1   input to second list: paramenter1, column in first list: field2 input to second list: parameter2

    4.       In Common Data View Tasks, set filter for second list, filter the field in second list based on the conditions and parameters.

    More information, Connect data in Web Part: http://office.microsoft.com/en-us/sharepoint-server-help/connect-data-in-web-parts-HA101785157.aspx

     

    Thanks,
    Qiao Wei


    Thursday, September 29, 2011 3:18 AM
    Moderator

All replies

  • Hi Selvarani,

     

    To achieve this, you can set second list data view web part to get parameter from first list, then filter the second list based on the parameters get from first list, try the following steps:

     

    1.       Insert two web part zone, then insert data views for first list and second list.

    2.       For the second list data view web part, in Common Data View Tasks, choose Web Part Connections.

    3.       Set the Web Part Connections as below:

    a. choose the action on the source web part to use for this connection: Get Parameter From

    b. choose Connect to a Web Part on this page

    c. set choose the columns in the source web part which match the input parameters for the target web part: column in first list: field1   input to second list: paramenter1, column in first list: field2 input to second list: parameter2

    4.       In Common Data View Tasks, set filter for second list, filter the field in second list based on the conditions and parameters.

    More information, Connect data in Web Part: http://office.microsoft.com/en-us/sharepoint-server-help/connect-data-in-web-parts-HA101785157.aspx

     

    Thanks,
    Qiao Wei


    Thursday, September 29, 2011 3:18 AM
    Moderator
  • Thanks a lot :):) it worked fine
    Selvarani
    Thursday, September 29, 2011 12:42 PM
  • Hi Qiao Wei,

    Thanks you for your post. I have been trying to use above solution for my purpose which is quite similar to what Selvarani has said, However it does not work for me. I am not if i am doing it correctly or not.

    This is what i need:

    I wish to filter my Child List based on Start Date and End Date specified in To master List.

    Master List: Meeting Details

    This list will hold values of my meeting and will filter my Incident list

    Filed: MeetingDate (Date Only), PreviousWeekStartDate (Calculated Column to get start date of week based on meeting Date), previousWeekEndDate (Calculated Column to get end date of Week  based on meeting Date) E.g if meeting Date is 23/05/2013 then my PreviousWeekStartDate =19/05/2013  previousWeekEndDate =25/05/2013

    Child List: Incidents List

    Field: Created Date, ID etc..

    What i want is, have one page with two webpart that shows meeting detail and Incident details(which should show incidents occured in week prior to the meeting date)

    This what i have been doing unsuccessfully.

    1. Create Webpart connection and Select PreviousWeekStartDate as param1 and PreviousWeekEndDate As param2.

    2. Filter my Incident for Created is Greater than or equal to Param 1 AND Created is Less than or Equal to Param2

    But ironically it shows no data.

    I suspect is gives me no record matching my filter because i am strong calculated column value in param1 and param2. i also tested param1 and param2 stroing value from non calculated field but it also not working.

    Many thanks in advance

    You help is very much appreciated.

    Regards,

    Nirav

    Tuesday, May 28, 2013 2:49 AM