Query

2018-03-28 19:16:00.0
Community Management

Queries

What is a query?

Queries can accomplish a few different tasks. Primarily, queries are used to find specific data by filtering specific criteria. Queries can also calculate or summarize data, as well as automate data management tasks. Other queries include parameters, totals, crosstab, make tables, append, update and delete. For example, a parameter query runs variations of a particular query, which prompts a user to insert a field value, and then it uses that value to create the criteria, while totals queries allow users to group and summarize data.

How to create a query

The basic steps in order to create a query are - create a query and name it, then set rules and parameters to the query and add the query to the query component.

On Kademi's main menu on your website

  • Click on data 

  • Select search indexes

  • Then scroll down and select Profile in the index column

Create and name your query

  • Click and select create query

  • Add a meaningful name to your query

  • Save by selecting ok button

For this demo, we created 2 different types of queries

  1. A normal query and

  2. an aggregation query

Profile mapping names

The more applications installed on your website the more profiles you will have on the search indexes, this indexer states all the profile mapping options that you can select and use when setting rules and aggregations to a query.

  • In order to get to the profile indexer, go to

  • Search indexes

  • Scroll down and select profile under the index column

How to use the profile mapping indexer (STEP 5)

If you want to find a field and rule for your query or uncertain of which mapping field to use for the query, this screen will help you,

e.g. - If a Manager wanted to see a users progress for an e-learning course, scroll down and look for a profile called module status and a field called "percentComplete", this is the field you would add to your query rule and rule type, the next few illustration below will show you how this is achieved.

  • Select the mapping tab

  • Scroll down and find the required field needed

Add roles to a query

Select your query and proceed to the next screen

  • Go to queries

  • Click on the query you would like to edit

Adding rules to your query (using filters)

  • Click on the add rule button and set the type of rule you are going to use by clicking on each filter.

1st field -  Field, These are the properties (e.g - name, type of profile, name, website) that you will filter 

2nd field - Operation, how you going to compare an operation to another and how it filters  

3rd field - Value, this is the what will be comparing against or checking. ( e.g - check if a user has completed an e-learning course).

Once you have added the rule to your query

  • Click on the run button to process the query

  • Save

  • Click on the results tab

  • Click on the select fields button

  • Add the result fields that are required

  • scroll down and save

  • This is the result of the fields selected for your query

Creating an aggregation query

Do the same steps as the above pictures

Click on the aggregation tab

Select the add aggregation button to add an aggregation query

Add the fields required for your query

Save

Adding query tables to a webpage

  • Click on Content

  • Go to edit web pages

  • Select a page and click on the edit button

Adding query components to containers

  • Add a suitable container

  • Go to the components tab

  • Search for query or click on reporting

  • Add the required components to the container for your query

Add details for the query to function

  • Click on the settings button for each component

  • Add the title

  • Select the type of query you will use

  • Select the query you will use for the component

  • Save

View you queries live on your webpage