My first Query in GXquery

This document shows, step by step, how to create a quick query with GXquery 4.0. Queries are made on the Travel Agency Knowledge Base.

Before starting verify GeneXus X Evolution 2 Hardware and Software Requirements and GXquery 4.0 Requirements.

Step 1

Creating the work environment for TravelAgency

Specify and generate all the objects in the KB and enter data. 

Step 2

The group of Query Elements  used to make the queries is located inside what is known as metadata. Therefore, we will need this metadata to do the exercise: Creating a GXquery metadata in GeneXus.

Step 3

Open the GXquery 4.0 session and you will see an image similar to the one below.

GXquery4 Login

If you are a registered user you can load your credentials. Otherwise, use the following default credentials:

User:   administrator
Password:   administrator123

Step 4

Select the TravelAgency metadata from the Metadata combo box and press the  Change button.

GXquery4 - Load TravelAgency metadata

This will make all the information contained in the metadata available to be used in this exercise.

Step 5

Press the New pivot table icon, and in the Name cell write MyFirstQuery. Repeat this in the Description cell and press OK.

GXquery4 - Assigning name to MyFirstQuery

Step 6

You will now see an image similar to the one below.

GXquery4 - Showing the IDE MyFirstQuery

The subdivisions on the left represent the various areas of a Pivot table (for further information on this go to Anatomy of a Pivot table). In these we will release the attributes we select in the window on the right, which represent the values we expect to have for cross referencing.

The graph we will do should show the number of attractions (Attraction Transaction) located in each city of each country (Country Transaction).

Drag and drop the Country Name, City Name and Attraction Name attributes into the area or rows, that is, the one labeled as “Drop row attributes here”.

Then drag and drop the Attraction Name attribute again, but this time in the data area, that is, the one labeled “Drop data attributes here”.

Step 7

Press the View icon and you will see the Pivot table in a way similar as in the following image.

GXquery4 - Pivot with dirty titles

Note that the column located to the far right indicates the number of attractions, and for each city, the total of attractions.

The name of this column is Attraction Name 1 because there is already a row with that name and we cannot have two elements with the same name. To change the name to as follows:

1. Press the Edit icon to edit the graph again.
2. With the mouse, select the Attraction Name 1 attribute in the data area. Note the window Properties: Query element.

GXquery4 - Properties of Attraction Name 1

3. Change the text of the Description cell and replace it with the text “Quantity”, then press View again and note the change in the column’s name.

Now you can dispose of all the remaining documents of GXquery 4.0!

See also