32
AM Queries and Views

AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Embed Size (px)

Citation preview

Page 1: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

AM Queries and Views

Page 2: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Overview

Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that allows for dynamic queries and reports.

Can be performed through user interface without need for Crystal Reports or other reporting package

Results can be exported to Excel

Simple one-click query engine

Robust querying language for more complicated inquiries

Note that more complex reports (reports with grouping, reports needed formatting) must be created in Crystal Reports. This is outside the scope of this course.

Page 3: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Terminology

View: any AM screen that shows a list of records at the top of the screen and detailed information about certain specific records at the bottom

Examples: My Open Work Orders, My Timesheet, many others

Query: The logic that determines what records are displayed in a view. Example: For “My Open Work Orders,” show all records that were opened by

the current user and the work order status is not complete or cancelled

Operators: Special symbols that are used in writing queries AND, OR, NOT =, <> (matches exact values) LIKE (matches text patterns using the special wildcard symbol: %)

Manufacturer LIKE ‘DYNA%’ matches DYNATECH and DYNAMAX but not GENERAL DYNAMICS; %DYNA% would include GENERAL DYNAMICS also

Report: A more formal view that incorporates formatting, highly complex queries, etc… typically these are run in Crystal Reports.

Page 4: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Portrait of a Database

Page 5: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Introduction to the Simple Query Filter

The simplest way to run a query is to right-click on the field you’d like to query on. In this case, we’re querying on the status of the work order to limit our list to only work orders that are awaiting service.

Page 6: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Introduction to the Simple Query Filter

Choosing “Filter on this field” when you right-click on any form element opens up the simple query filter box. The box is automatically populated with the element that you clicked on. Click on the flashlight icon (or press F5, or the Enter key twice) to apply the filter.

Page 7: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Introduction to the Simple Query Filter

Note: Right-click anywhere in the query box and choose “Remove this filter” to clear the filter and return to the original list.

Page 8: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Exercise 1

Using a simple query filter, display a list of all work orders on devices with a Risk Class of “Life Support.”

Page 9: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Using Multiple Simple Filters

Simple query filters can be combined to refine your search results. By adding a simple filter from the Work Order menu, you can perform a search using two criteria. (Note that this is an AND search: results will match both criteria you specify. We’ll cover OR searches later.)

Note: Unfortunately you can’t use the right-click method more than once per screen; it’ll wipe out all other filters.

Page 10: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Using Multiple Simple Filters

Use the pulldown to select the second field you’d like to query. In this example, we’re querying on Status = Awaiting Service and Work Order Type = Maintenance.

Page 11: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Exercise 2

Using a combination of simple query filters, display a list of work orders that were opened after July 1, 2011 and completed before July 31, 2011. (Hint: you’ll need two simple filters, one based on Start Date and another based on Complete Date.)

Page 12: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Hints on Finding the Field You Want

Note: Sometimes when using the query box it can be difficult to find the field you want to search for. In the previous example, for instance, the Work Order Type field was actually located under Links → Work Order Type. The rule of thumb is that if there’s a magnifying class next to a field on the form, it’s going to be located under the Links section of the query box pulldown:

Remember, you can just right-click on the field you want tofilter on, and choose “Filter on this Field.” Simple as that!

Page 13: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Saving your Newly-Created View

Views can be saved for your future use. Save your view under Tools > Views > Create a Custom View, give your view a name, and press Add:

Your custom view will then be visible in the Navigation Bar under User Views:

…try saving your view from Exercise 2 now!

Page 14: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Exercise 3

Using a combination of simple query filters, display a list of Incoming Inspection work orders that were opened after July 1, 2011 and completed before July 31, 2011. (Hint: Modify the query you created in Exercise 2.)

Page 15: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

You can easily add fields to your view by right-clicking on the field and selecting “Add this column to the list.”

Try adding Serial Number to the work order view you created in Exercise 3. Remember to save your updated view when you’re done! (Tools → Views → Modify Current View). We’ll reorder the columns later.

Adding Columns to your Results

Page 16: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Exporting to Excel

Exporting the results of a view to Excel can be useful for emailing data, making charts and graphs, printing out lists, etc.

You can export any list in AM by right-clicking anywhere on the list portion of the view, then under Utilities, look for “Export the list…”

Page 17: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Grouping Your Query Results

You can also group your query results by any field you like. Right click on the field you’d like to group by, then select “Group by this field” or “Group by this link” (like on “Assigned To” in your previous exercise). Your results will even remain grouped when you export to Excel. Cool! (Undo the grouping by right- clicking anywhere in the list and selecting “Ungroup all.”)

Page 18: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Break Time!

Page 19: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

AM Queries and Views

… part two!

Page 20: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Advanced Queries

Asset Manager provides a more sophisticated query language that provides all of the capability of simple queries, but with added features like OR and NOT.

Access the Advanced Query window by clicking on the filter icon at the bottom-right of any list:

Page 21: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Advanced Queries, Continued

In the Advanced Querywindow, you build yourquery by selecting whichfield you want to queryon…

Then the value you

want to match…

Page 22: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Advanced Queries, Continued

And finally, click the red down arrow to build the query based on your selections:

Press OK to run the query and see the results. You’ll notice that the filter icon you pressed to enter the Advanced Query window is now red. This is an indication that an advanced query is being used to display your results.

Page 23: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Exercise 4

Using the Advanced Query window, design a view that displays all work orders where the work order status is “Awaiting Service.” (Note: You could do this with a simple query, but let’s practice the advanced query method here.)

Page 24: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Using Operators

You’ll notice that the down arrow isn’t your only choice when building your advanced query. There’s also an AND down-arrow button and an OR down-arrow button. You can use these to create more complex queries.

Page 25: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Exercise 5

Building on the advanced query you wrote in Exercise 4, write an advanced query that displays all work orders that are either Complete or Awaiting Service.

Page 26: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Exercise 5A

Change the OR to and AND for the query you wrote in Exercise 5, and view the results. What happened? Why?

Page 27: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

CurrentUser: A Very Special Variable

Asset Manager’s query language includes a special variable called CurrentUser. It must be typed in manually as it is not included in any of the pulldowns, but it can be very handy. Whenever you use CurrentUser, AM will automatically substitute the name of whoever’s logged in at the time… i.e. YOU.

Use the CurrentUser variable to automatically include your own name in queries.

Page 28: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Exercise 6

Using the CurrentUser variable, search for all the work orders in the database that are assigned to you.

NOTE: Finding the Assigned To field can be tricky. Asset Manager often stores data in separate lists, like lists of Employees, Vendors, or Manufacturers. It stores links to these lists under the Links section. When choosing the Assigned To field, look under the Links section of the field you’re searching on (it’s hidden at the top of the list… you’ll have to scroll up to find it, then expand the list of links). In general, if you can’t find the field you want under the list of fields, check the links section too.

I’ll be distributing a “cheat sheet” that shows you where to find some common fields in the hierarchy. Eventually you’ll develop a feel for where they are on your own.

Page 29: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

We’ve already learned that you can right-click on a field and choose “Add this column to the list” to include a column in your view. You can also click on the “Columns and Sort” tab in the Advanced Query window, choose the field you want to add in the hierarchy, then press the right arrow button to add it to your list.

You can also change the order of columns in the list. Try it out! (Hint: Use the up and down arrow buttons in the middle of the window)

Adding and Reordering Columns in your View

Page 30: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Exercise 7: The Kitchen Sink!

Design a query that shows only Malfunction Reported work orders (that is, work order type is “Malfunction Reported”) that are assigned you, and that were opened on or after 7/1/2011, and are either currently In Progress or Awaiting Service.

Help each other out!

Page 31: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Something Cool: StatisticsYou’ve already learned how group your query results by any field you like. You can also do this graphically! In your “kitchen sink” example, locate the Risk Class field (hint: it’s on the More Info tab), right-click on it, and select “Statistics pertaining to this link,” and watch the magic happen. (You can also do this from the list at the top of the form: Right-click on any column and choose “Utilities → Statistics on this column.”) Right-clicking on the graph gives you plenty of configuration and printing options, too. Sweet!

Unfortunately, this feature seems to be somewhat experimental and doesn’t always return results. It’s worth playing around with, though.

Page 32: AM Queries and Views. Overview Asset Manager provides sophisticated querying and reporting capability, from simple filters to a complex language that

Homework

Play around! Don’t hesitate to experiment and help each other out. Create your own custom views and save them for use in your daily activities.

Thanks for coming!