20
An End-User Perspective On Using NatQuery Building an Expression Variable www.natworks-inc.com T. 802 485 6112

An End-User Perspective On Using NatQuery Building an Expression Variable T. 802 485 6112

Embed Size (px)

Citation preview

Page 1: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

An End-User PerspectiveOn Using

NatQueryBuilding an Expression Variable

www.natworks-inc.com

T. 802 485 6112

Page 2: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

This session will skip over certain “steps” required for building and submitting basic queries. For a specific overview of; How to Build a Query, please refer to that Power Point Slide™ Show found on our web site Slide Show page.

Our user wishes to know two pieces of information; unique employees living in specific cities and their total salaries.

This example of NatQuery is being run against ADABAS on Linux in a PC network environment.The following screen shots may differ in your environment however the processing will be similar.

Page 3: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

ADABAS database recurring fields are represented to the user by trailing parenthesis. The number of occurrences available to the user will be within these parenthesis's – PE’s or MU’s. A Field shown as; Bonus (All,All), tells the user that there are recurring fields within the Field – MU’s within PE’s.

Page 4: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

To begin this query the user has chosen the logic: NAME – Equals – a List variable. Here we see the Define List Variable window and that the user is about to ADD the name ADKINSON #4.

1

23

4

Page 5: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

When the user chose the Field, SALARY they noticed that there was the word ALL in parentheses. They know this means that there are multiple occurrences for this Field. The user wants the total of all occurrences so they will need to create a Variable such that all values of the reoccurring Field will be represented by a single occurrence in the output file.

They begin the process by clicking the Variable icon and then clicking the Add button in the List Query Variable window.

Page 6: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

In the Define Query Variable window the user can give their new variable a user friendly name, chose to include the variable in the outcome, and set the Length and Format. Choosing the Type and Value, in this case Expression, enables the Define Value button and will allow the user to begin creating the new variable.

Page 7: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

This variable will come from the File EMPLOYEES that is found in the Field SALARY.

This new variable will be an addition expression of the five occurrences that make up the Field SALARY. The user has added the first Occurrence and has now chosen Occurrence 2, clicking OK in the Specify Field Occurrence frame will set the #2 in the Expression Definition frame and enable the Operand options.

Page 8: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

NatQuery recognizes that a pattern is developing in the users actions and now asks if they would like to “skip ahead” to the conclusion of the expected expression.

Page 9: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

NatQuery has finished the expression and added a scroll bar to the Expression Definition window for the users optional review. At this point the user could also add, subtract, multiply, or divide another field, a variable, or a value to this expression.

They may also check a box to a Conditionally Assign this variable if they choose.

Page 10: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

The finished Expression value is shown in the Current Value of Variable frame, if acceptable the user will click the OK button.

Page 11: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

The new variable is now part of this query and will be seen in the Query Selected Fields window after the user clicks OK in the List Query Variable window.

Notice that an ellipse has been set in the new variable value to make up for the lack of room to show the entire expression in the window.

The user should now click the OK button.

Page 12: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

Note that the new variable now shows in the Query Selected Fields window because the user previously chose to include it with all the other extracted fields.

The user is now ready to click the Send to Server icon.

This example will skip over several of the submission and retrieval windows, assuming that the user is familiar with the individual processing steps needed.

Page 13: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

Note that in the Database Field Information window the Recurring Field, Salary, will display each occurrence of that Field.

Page 14: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

In the retrieved data shown here in the target Excel spreadsheet note that each occurrence of the Recurring Field Salary is shown in an individual column. Our example query goal was to show the Total of these recurring fields – which it does in the column Total Salary.

Page 15: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

In order to remove the redundant fields in the output the user will need to go back to the source file and Modify the fields they wish to have returned.

Start by highlighting the File that contains the field you wish to modify, in this case there is only one File to choose from. Then click the Modify button to bring up the Select Fields from Filename.

Page 16: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

From the Select Fields to retrieve frame the user would highlight the Fields they wish to remove and then click the Delete button.

Note that Total Salary is not included here because it is not a Field in the File, it is a specific user defined query variable that the user chose to include with the extracted fields when they created it.

Page 17: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

Note that the Recurring Field Salary is no longer in the Query Selected fields window.

The user is ready to resend this query to the server.

Page 18: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

The Recurring Field Salary is not present in the Database Field Information window.

Page 19: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

Here, the data has been downloaded into the target Excel spreadsheet and we see that the multiple salary columns have not been returned with the retrieved data.

Page 20: An End-User Perspective On Using NatQuery Building an Expression Variable  T. 802 485 6112

URL: www.natworks-inc.comE-Mail: [email protected]

454 South Main StreetNorthfield, VT 05663

T. 802 485-6112

Where do you need Your ADABAS Data today?