locked
CQWP additional filters RRS feed

  • Question

  • I am trying to figure out a way to get around the 3 filter limit utilizing the interface for CQWP. I currently have a dashboard set for my individual team members that needs to filter off options of the same column.

    example:

    Filter one: assigned to = team member

    Filter two: Task status = QA

    Filter three: Task status = Returned by QA

    Would there be a way to consolidate filter two and three as I have more task statuses I need to filter on (so Task Status = 'QA' or 'Returned by QA')? Or if I have to go into the code behind I'd appreciate an easy to follow instruction, I'm not the strongest programmer

    Wednesday, February 22, 2012 2:52 PM

Answers

  •  

    Hi flashfx21,

    You can use  the XML (CAML) in the CQWP webpart  by replacing the “QueryOverride” tag. The following code is from a link,  this article is very detail to it.

    <property name="QueryOverride" type="string">
           <![CDATA[<Where>
                        <And>
                          <And>
                            <And>
                              <Or Group="true">
                                <Leq>
                                  <FieldRef Name="PublishingStartDate"/>
                                  <Value Type="DateTime">
                                    <Today/>
                                  </Value>
                                </Leq>
                                <IsNull>
                                  <FieldRef Name="PublishingStartDate"/>
                                </IsNull>
                              </Or>
                              <Or Group="true">
                                <Gt>
                                  <FieldRef Name="PublishingExpirationDate"/>
                                  <Value Type="DateTime">
                                    <Today/>
                                  </Value>
                                </Gt>
                                <IsNull>
                                  <FieldRef Name="PublishingExpirationDate"/>
                                </IsNull>
                              </Or>
                            </And>
                            <Eq>
                              <FieldRef Name="Document_x0020_Type" />
                              <Value Type="Text">Notice</Value>
                            </Eq>
                          </And>
                          <Eq>
                            <FieldRef Name="Meeting_x0020_Category" />
                            <Value Type="Text">Board Meeting</Value>
                          </Eq>
                        </And>
                    </Where>
                    <OrderBy>
                        <FieldRef Name='Created' Ascending='FALSE' />
                    </OrderBy>
              ]]>
        </property>

    You can refer to the following link.

    http://sharepointroot.com/2011/06/03/cqwp-with-more-than-three-filters/

    Thanks,

    Jack

    • Marked as answer by flashfx21 Monday, February 27, 2012 2:25 PM
    Thursday, February 23, 2012 8:13 AM
    Moderator