DATA WAREHOUSE Extras September 2010 First Edition: October, 2004 Second Edition: May, 2005 Third Edition: March, 2007 Current Edition: September, 2010 © Oregon State University, 2010 Table of Contents Super Queries 1. Modify Existing Report.......................................................... 39 • Range Filter • Show Super Query • Load Report Specification 2. Build a Super Query ............................................................... 40 • Stack Prompts • Retain Results • Desk Top Join 3. Modify a Super Query............................................................ 40 • • • • Edit a Query Component Save a Query Component Add a Range Operation Add a Sort Operation Report Tricks 4. Combine the Address Columns & String the Phone and ID .. 41 5. Stack the Degree Columns & Add a Subtotal ........................ 42 6. Report Borders....................................................................... 42 Export Buttons 7. Create an Export Button ........................................................ 42 xiv Data Warehouse Extras Super Queries 1. Modify the Existing Report ‘Pooled Positions by an Org’ to include only the records that are students employed by Information Services. • If you have access to the Human Resources Model, sign on with your own Database User and Password. Otherwise use the training user ID and password. • Navigate to the HUMAN RESOURCE MODEL design view and REPORTS window. • Click on the [Pooled Positions for an Org] button, enter “121200”, and click [OK]. This report is all the current positions that are pooled. Note that not all positions are students, and that we are looking only at JIS - Central Computing … we want to change both. • • Close the report and results set, and find the Query in the HUMAN RESOURCE MODEL. Open the POSITION object. Notice that the qualification statement for Major Org has a “Begins with” operand. That means that we do not have to change the query itself to include all of IS – we only have to change what we enter in the prompt. We do, however, need to modify the query sort to handle the whole organization … • • Range Filter • • • • • Change the primary sort by double clicking in the ‘Sort’ column. Move POSITION REPORTS ORGANIZATION DESC out of the sorted attributes, move POSITION REPORTS ORGANIZATION in and up to the primary position and click [OK]. Click on the [Run Query] button, change the prompted value to “12”, and click [OK]. Close the report, and get back to the Query Results. Filter the results by selecting ‘Results | Filter | Range…’. Click on POSITION CLASS CODE, type “XA” in the ‘Is > than or =’ box, type “XB999” in the ‘Is < than or =’box. Choose the ‘Action’ of [Include rows] and click [OK]. Notice now that by filtering the results set, you have created a Super Query. Show Super Query • With the results ‘Pooled Positions for an Org.1’ window active, display the Super Query by selecting ‘Query | Super Queries… | Show Super Query’. • Save the Super Query by selecting ‘Query | Save | Query …’. Notice the query has the original query name and the Save Queries window is positioned where you can select either the Admin or the User folder. Make sure that you save the changes in your own folder … • • Click on the [My Queries] button, change the name if you want to, then click [Save]. Select ‘Results | Show as Report | BI Query Standard’. Notice when you take the new results set into a report, that the report formatting from the original button may lost. You can save a great deal of time recreating the report by loading the original specifications … Load Report Specification • Close the report, select ‘Results | Show as Report | Open Report Specification…’, click the [Shared Reports] button, select ‘Pooled Positions for an Org’, and click [Open]. You saved the Super Query, remember to save the report with the query … • • • Select ‘Report | Save Report Specification…’, and you should have a warning: Click [OK], click [My Reports], and find your saved Super Query. Then click [Save] and [OK] the file replacements. • Close the HRIS Model. 39 2. Build a Super Query containing graduates from the College of Science (08) last spring. Include the major codes and descriptions with contact data. Eliminate any international studies programs, and order the report by their Level, Primary Majors, and last name. • • • Stack Prompts • • • • • • • • • • Retain Results • • • • • • Desktop Join If you have access to the Student Model, sign on with your own Database User and Password. Otherwise use the training user ID and password. Navigate to the STUDENT (ALL TERMS) design view. Open the DEGREE object and create qualifications for the attributes: GRAD COLLEGE using the ‘Get!1College’ prompt, DEGREES LEVEL using the ‘Get!1Level’ prompt, change the operand to ‘Begins With’, GRAD TERM using the ‘Get!1Term’ prompt. Select the DEGREES LEVEL attribute, and select SORT. Select the GRAD MAJOR1 attribute, and select SORT. Close the DEGREE object, open the STUDENT object. Select the LFM NAME attribute, and select SORT. Select the STUDENT ID (and PIDM) attribute. Run the Query using College = “08”, Level = “0”, and Term = “200603”. Get all rows. Note the ‘Query Results’ number ( __ ) and number of rows ( __ ) for use later. Move the Results set off to the right of the window. Click in the Object window, start a new query and move to the VAL TABLES design view. Open the MAJOR MINOR CONC object, and select attributes MAJOR CODE and DESCRIPTION. Run the query, Get all rows, and note the ‘Query Results’ number ( __ ). To join the Results sets, select ‘Results | Combine | Join Columns …’. Check that the two listed Query Results are the previous two you noted. Move the first query results into the ‘Left results’ field. Change the DEGREES LEVEL attribute to GRAD MAJOR1 in the left result set’s dialog box. Click the left check box to ‘Include all left rows’ and click [OK]. BI/Query sorts the unsorted results set and creates a Super Query result set (X.1.1) containing one new record each time the two values match … note that the Grad Major1 is included and Major Code is not. • Save the Super Query, making note of the name ( _____________________________ ). 3. Modify the SUPER QUERY to exclude students that have elected Confidentiality and also any students in International Studies programs. • • • Close all results windows and select ‘Query | New’ from the pull down menu. Select ‘Query | Open …’ from the pull down menu, and select your saved Super Query. Click on [Open]. A Super Query dialog box opens with a graphic depiction of the Super Query. The Queries that you joined are represented by a Query Button with a “?” on it, labeled “Untitled.” You can rename the Queries by right-clicking the Query Button, selecting ‘Rename selected query,’ and typing in a name that is meaningful to you (we will use Student and Val Tables). The sort is named by the attribute used for the sort. To modify one of the two Queries … Edit a Query Component 40 • • • Select ‘View | Toolbar | Super Query’ from the pull down menu. Click the STUDENT query, and click [Edit Selected Query] in the Super Query toolbar. Open the STUDENT object. Data Warehouse Extras • • • Click in the ‘Qualify’ box on the CONFIDENTIAL FLAG attribute. Type in “Y” and change the operand to ‘!= Not Equal’. Select the attributes DIRECTORY STUDENT E-MAIL, CURRENT ADDR COMBINED PHONE, CURRENT ADDR STR LINE1, and CURRENT ADDR CSZ. • Run the Query and get all of the remaining rows. Note that there may be a difference in the number of rows returned in the results because of Confidentiality … Save a Query Component • • Locate the Super Query window in the ‘Window’ pull down menu (you may have to select ‘More Windows …’ first), and select the Query you have modified. Click the STUDENT query, and click [Replace Selected Query] in the Super Query toolbar. Remember that we wanted to eliminate any international studies programs … Add a Range Operation • • Hover over the buttons in the Super Query toolbar, and click [Add Range Operation]. Select GRAD MAJOR1, choose the [Exclude rows] ‘Action’, type “910” in the ‘Is > than or =’ box, type “910” in the ‘Is < than or =’box, and click [OK]. You may want to test your Super Query by running it to look at the results. Notice that there are fewer records because of the filter, and there are some funny things about the sort order of the results … Add a Sort Operation • • • • Run the Super Query, and examine the super query results in the Level Code data. In the Super Query window, click on the Join icon and [Add Sort Operation] button. Sort by DEGREES LEVEL, GRAD MAJOR1, and LFM NAME. Run the Super Query. Don’t forget to … • Save the modified Super Query. Report Tricks 4. Combine the Address columns & String the Phone and ID: • • • Move the super query results to create a BI/Query Standard report. Reorder the columns so that DESCRIPTION follows GRAD MAJOR1. Suppress duplicates in the DESCRIPTION column. We were not able to use the Current Address Combined Windows attribute because of its multi-line format, so you may want to put the address fields together to save some space … Combine Columns • • Select the CURRENT ADDR STR LINE 1 column, shift select the CURRENT ADDR CSZ column. Choose ‘Report | Combine Columns …’, and click [OK]. Notice that you have a drop down list of separator options to place between the data … Format String • • • • Select the ‘,<Space>’ separator, click [OK] and expand the resulting column. Double click on the CURRENT ADDR COMBINED PHONE column. Type “(###) ###-*” in the ‘Format String Box’ Double click on the STUDENT ID column, and type “###-###-*” in the ‘Format String Box’ You may want to change the column headings and report title before you save the changes ... • Select ‘Report | Save Report Specification…’, click on [Save], and [OK] the file replacements. 41 5. Stack the Degree Columns & Add a Subtotal: To subtotal on a single field after multiple fields have been put together, you must stack the columns … • Select the DEGREES LEVEL column, shift select the GRAD MAJOR1 and DESCRIPTION columns, then choose ‘Report | Stack Columns’ from the pull down menu. • Click on the Grad Major1 value, then choose ‘Report | Add Subtotal’. Stack Columns 6. Add Borders: • Select ‘Report | Borders…’, add the graphics that you want, and click [OK]. Each report component has specific line attributes associated to it, which is displayed in the ‘Simple Report’ area as the component is selected. You can choose the line style and color for each component. • • Finish formatting your report, and select ‘Report | Save Report Specification…’, click on [Save], and [OK] the file replacements. Close the report and the results windows and start a new query. Export Buttons 7. Create a BUTTON to export any query results into a spreadsheet. • • • • • • • • • Move to the STUDENT (ALL TERMS)` window. Click on the [Design Mode] button. Click on the [Button] button at the top of the vertical toolbar, and create a new button by clicking and dragging diagonally in a free area of the 'User Queries' design window. To Edit Text of the button, double click on the new button, and click on [Edit Text …]. Name the button and click [OK]. Click on the drop down arrow in the ‘Output To’ area and then select [Application]. Click on the [Export Options] button, and change the application to [Microsoft Excel]. Browse for the full path name to the application by clicking on the […] button. Click [OK] and place button where you want it … resize if necessary. Create a Query … • • • Open the STUDENT object and select the LFM NAME and STUDENT ID attributes. Close the STUDENT object and Open the CURRENT object. Select the HOURS RGGISTERED attribute, qualify it to >= 20, and make it a descending sort. Check out your button … Please close the software and any open desktop folders, choose ‘Shut Down’ from the [Start] button, and choose ‘Log Out’. 42
© Copyright 2026 Paperzz