Query examples
Using Basic mode
This query extracts those individuals whose companies are located in the state of Texas.
- In the Staff site, go to RiSE > Intelligent Query Architect > New > Query.
- (sources tab) > Add Source.
- Common > Business Objects.
- Select CsContact twice.
- In the Relations area of the Sources tab, make sure the custom relation is CsContact.Company Id Equals CsContact1.iMISId.
- (filters tab).
- Mode: Basic
- Filter on CsContact.MemberType.
- Property: CsContact.MemberType
- Comparison: Equals
- Value: Regular Member
- Click + to add the filter.
- Filter on CsContact1.StateProvince.
- Property: CsContact1.StateProvince
- Comparison: Equals
- Value: TX
- Click + to add the filter.
- (display tab) Define the columns to display in the output.
- Select the following columns:
- CsContact.iMISId
- CsContact.Company
- CsContact.MemberType
- CsContact1.StateProvince
- Using the Order column on the Display tab, assign the following order:
- CsContact.iMISId
- CsContact.Company
- CsContact.MemberType
- CsContact1.StateProvince
- (sorting tab). Specify the sorting priority.
- Sort the results by CsContact.Id.
- Click + to add your selection.
- Save your settings.
- Run the query.
Note: When you add multiple instances of a source, the system automatically appends a numeric value (beginning with the number 1) to the second source and all following sources in order to distinguish between each instance. For example, if you add the CsContact business object three times, the system labels the second and third instances CsContact1 and CsContact2, respectively.
Note: A default list of columns displays when you select the Display tab. Deselect the columns you do not need. If a column you need is not in the default list, select View all columns from the drop-down list and scroll down the page to select the desired column.
This query extracts customers who have purchased more than $100 within a specific date range.
- In the Staff site, go to RiSE > Intelligent Query Architect > New > Query.
- (sources tab) > Add Source.
- Common folder > business objects.
- Select the CsContact and CsActivityBasic business objects.
- Use CTRL to select multiple objects
- Make sure the default join in the Relations area is Contact.iMIS Id Equals CsActivityBasic.Id.
- (filters tab).
- Mode: Basic
- Filter on CsActivityBasic.Activity Type.
- Property: CsActivityBasic.Activity Type
- Comparison: Equals
- Value: ORDER
- Click + to add the filter.
- Filter on CsActivityBasic.Transaction Date.
- Property: CsActivityBasic.Transaction Date
- Comparison: Between
- Value: "1/1/2011","12/31/2011"
- Click + to add the filter.
- Filter on CsActivityBasic.Amount.
- Property: CsActivityBasic.Amount
- Comparison: Greater
- Value: 100
- Click + to add the filter.
- (display tab) Define the columns to display in the output:
- Using the Order drop-down list on the (Display tab), assign:
- CsContact.iMIS Id Order 1
- CsActivityBasic.Amount Order 2
- (sorting tab) Specify the sorting priority.
- Sort the results by CsContact.iMIS Id.
- Click + to add the selection.
- Save your settings.
- Run the query.
Note: A default list of columns displays when you select the Display tab. Deselect the columns you do not need. If a column you need is not in the default list, select All from the View drop-down list and scroll down the page to select the desired column.
- In the Staff site, go to RiSE > Intelligent Query Architect > New > Query.
- Mode: Basic
- (Summary tab) Enter the name and description for this query.
- (Sources tab) Select Add Source > Common > Business Objects > CsContact.
- (filters tab) select:
- Filter on StateProvince.
- Property: StateProvince
- Comparison: Equals
- Value: New York
- Click + to add the filter.
- Filter on MemberType
- Property: MemberType
- Comparison: Equals
- Value: Regular Member
- Click + to add the filter.
- Filter on StateProvince.
- (display tab) Select View > Selected columns. Select the columns to display and the order.
- Click Run. Depending on your system’s display settings, your results could display similarly to the following image.
Example query results: Members from New York
- In the Staff site, go to RiSE > Intelligent Query Architect > New > Query.
- Mode: Basic
- (summary tab): enter the name and description for this query.
- (sources tab) Select Add Source > Common > Business Objects > CsContact and > Activity.
- Use the default relation between the two business objects:
FK_ Name_Activity (When CsContact.Imis Id = Activity.Id) - (filters tab):
- Filter on CsContact.State Province
- Property: CsContact.State Province
- Comparison: Equal
- Value: New York
- Click + to add the filter.
- Filter on CsContact.Member Type
- Property: CsContact.Member Type
- Comparison: Equal
- Value: Regular Member
- Click + to add the filter.
- Filter on Activity.Activity Type
- Property: Activity.Activity Type
- Comparison: Equal
- Value: MEETING
- Click + to add the filter.
- Filter on Activity.Transaction Date
- Property: Activity.Transaction Date
- Comparison: Greater Equal
- Value: 1/1/2009
- Click + to add the filter.
- Filter on CsContact.State Province
- (display tab) Select View > Selected columns. Select the columns to display and the order. Select the Only display unique results option.
- Click Run. The results are a subset of the list in the previous example.
Example query results: Members from New York who attended the 2009 Conference
Using Advanced mode
This query extracts individual members who live in Texas or those who joined between 1993 and 1997, eliminating duplicates when the same rows are returned by the multiple subqueries.
- Go to RiSE > Intelligent Query Architect. Select New > Query.
- (sources tab) Browse to the Common > Business Objects folder, and select CsContact.
- (filters tab) Select the Advanced mode.
- Create a filter on Member Type:
- Comparison: Equal
- Value: Regular Member
- Click + to add the filter.
- Create a filter on State Province:
- Comparison: Equal
- Value: Texas
- Click + to add the filter.
- Click Add Filter.
- Select Or from the Property drop-down list.
- Create a filter on Member Type equal to Regular Member:
- Comparison: Equal
- Value: Regular Member
- Click + to add the filter.
- Create a filter on Join Dates:
- Comparison: Between
- Value: 1/1/1993 and 12/31/1997
- Click + to add the filter.
- Click + to add the filter.
- (display tab) Select the Only display unique results option.
- Select the following columns:
- iMIS Id
- State Province
- Join Date
- In the Order column, assign the following:
- iMIS Id – 1
- State Province – 2
- Join Date – 3
- (sorting tab) Sort the results by iMIS Id to specify the sorting priority.
- Click + to add your selection.
- Save your settings and run the query.
Note: A default list of columns is displayed when you select the display tab. Deselect the columns you do not need. If a column you need is not in the default list, select View all columns from the drop-down, and scroll to find and select the desired column.
This query extracts the total number of members who have made a pledge of $50 or more.
- Go to RiSE > Intelligent Query Architect. Select New > Query.
- (sources tab) Browse to the Common > Business Objects folder, and select the following business objects:
- CsContact
- CsActivityBasic
- (filters tab) Select the Advanced mode.
- Filter on CSActivityBasic.Activity Type:
- Comparison: Equal
- Value: PLEDGE
- Click + to add the filter.
- Filter on CsActivityBasic.Amount:
- Comparison: Greater
- Value: 50
- Click + to add the filter.
- (display tab) Select to display the CsContact.iMIS Id property:
- Function: Count
- Alias: Pledges
- Order: 1
- Save your settings and run the query.
Note: A default list of columns is displayed when you select the display tab. Deselect the columns you do not need. If a column you need is not in the default list, select View all columns from the drop-down, and scroll to find and select the desired column.
This query joins two business objects to extract the registrants for a specified event. At runtime, the user supplies the event code.
- Go to RiSE > Intelligent Query Architect.
- Browse to the folder in which you want to store a new query. Select New > Query.
- (summary tab) Enter a Name for the query.
- (sources tab) Browse to the Common > Business Objects folder, and select the following business objects:
- CsContact
- CsEventHistory
- In the Relations area, make sure the default relation is CSContact.iMIS Id = CsEventHistory.Id.
- (filters tab) Select the Advanced mode.
- Filter on csEventHistory.Event Code:
- Comparison: Equal
- Prompt: Optional or Required.
Note: Enter a prompt in the field, for example, Event Code.
- Click + to add the filter.
- (display tab) Select the following columns:
- CsContact.iMIS Id
- CsContact.Full Name
- CsContact.Company
- CsEventHistory.Event
Note: A default list of columns is displayed when you select the display tab. Deselect the columns you do not need. If a column you need is not in the default list, select View all columns from the drop-down, and scroll to find and select the desired column.
- Click Refresh.
- In the Order column, assign the following:
- CsContact.iMIS Id Order – 1
- CsEventHistory.Event Order – 2
- (sorting tab) Sort the results by CsEventHistory.Event.
- Click + to add the selection.
- Save your settings and run the query.
Note: If you want to show current registrants of open events, link to csRegistration instead of csEventHistory and set the default relation as CsContact.iMIS ID = csRegistration.Ship To ID.
Note: The primary difference between Cs and non-Cs objects is that the the non-Cs objects contain the .NET security, but Cs objects are basically just views pointing to the underlying non-.NET tables. When you use a non-Cs object, you might notice additional fields such as Access Key and Contact Key. These fields are important when you are linking to objects with security, such as a Campaign business object where a user must have certain security to be able to view data.
This query shows individual members with an AWARD activity type.
- Go to RiSE > Intelligent Query Architect. Select New > Query.
- (sources tab) Browse to the Common > Business Objects folder, and select the following business objects:
- CsContact
- CsActivityBasic
- (filters tab) Select the Advanced mode.
- Filter on CsActivityBasic.Activity Type:
- Operator: Where
- Comparison: Equal
- Value: AWARD
- Click the + icon to add the filter.
- Click Add Filter.
- Filter on CsContact.Member Type:
- Operator: And
- Comparison: Equal
- Value: Member
- Click the + icon to add the filter.
- (display tab) Select the following columns:
- CSContact.iMIS Id
- CsContact.Full Name
- CsContact.City
- CsActivityBasic.Description
- CsActivityBasic.ProductCode
- In the Order column, assign the following:
- CsContact.City Order – 1
- CsContact.Last Name Order – 2
- (sorting tab) Sort the results by CsContact.iMIS Id.
- Click + to add your selection.
- Save your settings and run the query.
In this example, the query finds all of the contacts created this year using the @Now variable to dynamically filter the query.
- Go to RiSE > Intelligent Query Architect. Select New > Query.
- (summary tab) Enter a Name for the query.
- (sources tab) Browse to the Common > Business Objects folder, and select the CsContact business objects:
- (filters tab) Select the Advanced mode.
- Filter on Date Added:
- Comparison: Between
- Value: 1/1/2014 and @Now
- Click the + icon to add the filter.
- (display tab) Customize the fields to display.
- Save your settings and run the query. When you run the query, it lists all of the contacts created so far this year.
This example uses the Query Menu content item and the Link feature to display completed orders to users.
- Go to RiSE > Intelligent Query Architect > New > Query.
- (summary tab) Enter the name Completed Orders for the query.
- (sources tab) Browse to the Common > Business Objects folder, and select the following business objects:
- CsContact
- CsOrderHistory
- (filters tab) Select the Advanced mode.
- (display tab) Select the following columns:
- CsContact.Full Name
- CsOrderHistory.Transaction Date
- CsOrderHistory.Id
- CsOrderHistory.Product Name
- CsOrderHistory.Product Code
- CsOrderHistory.Quantity
- Give the following properties an Alias prefaced with code_, so that the column value is hidden in the query results but can still be used as a reference in the Link:
- CsOrderHistory.Id – Alias code_ID
- CsOrderHistory.Product Code – Alias code_ProductCode
- For CsContact.Full Name, enter the following Link:
- For CsOrderHistory.Product Name, enter the following for the Link:
- (sorting tab) Select the CsOrderHistory.Transaction Date property and sort by Descending.
- Save the query.
- Go to Page Builder > Manage content, and add the Query Menu content item to a content record.
- In the Source query or folder field, select the Completed Orders query.
- Click OK, then save and publish your content record.
- Go to Site builder > Manage sitemaps, and add the content record to a navigation item. When the query results are displayed in your website, the results in the Account and Product columns are linked to the pages you defined in your query.
~/MyAccount&ID=[code_ID]
Note: This Link assumes that you have a shortcut named MyAccount pointing to a content record containing Contact content items that can use the ID URL parameter.
~/ItemDetail&iProductCode=[code_ProductCode]
Note: This Link assumes that you have a shortcut named ItemDetail pointing to a content record containing the General Product Display content item.