Conference 2017 Session Description: For experienced users of Aeries Query, covers applying advanced filters, hiding columns, and applying other tricks to a query statement. Also will cover pivot tables in Excel and importing and exporting data using Excel with a focus on data evaluation. 1. Exporting query results from Aeries.net to MS Excel 2. Importing query results from MS Excel to MS Access 3. using MS Access Crosstab query Multiple Table queries 4. Using MS Excel to Analyze Data Pivot Tables Pivot Charts Slicers Session 275 - Page 1
Exporting query results from Aeries.net and saving to a MS Excel file This example will use the following two queries Student Demographic query LIST STU IDN CSE SSD LOC STU.SC LOC.NM STU.GR STU.ID STU.NM STU.SX STU.LF? STU.SP? STU.HL? STU.ETH? STU.RC1? SBAC CST CMA CAPA query LIST STU TST CTL STU.SC STU.ID STU.GR TST.ID TST.TA TST.TD TST.PT CTL.NM TST.SS TST.PL BY STU.ID IF ( TST.ID = SBAC OR TST.ID = CST OR TST.CMA OR TST.ID = CAPA ) AND ( TST.TA = SPRG15 OR TST.TA = SPRG16 ) Run Query in Aeries.net by Clicking on the Excel button. When the query results are ready to be viewed, you will see the dialog box below. Click on the View Report button to open results using MS Excel. When prompted to open the file Click the Open button. After opening MS Excel workbook, Click on the Enable Editing button at the top. (In Yellow) Click on File > Save As > (Choose your file name and desired file location) > and click Save. Session 275 - Page 2
This MS Excel file was saved as with the following name: Student Demographic Data. Repeat this process for the second Query. The query is listed below. SBAC CST CMA CAPA query LIST STU TST CTL STU.SC STU.ID STU.GR TST.ID TST.TA TST.TD TST.PT CTL.NM TST.SS TST.PL BY STU.ID IF ( TST.ID = SBAC OR TST.ID = CST OR TST.CMA OR TST.ID = CAPA ) AND ( TST.TA = SPRG15 OR TST.TA = SPRG16 ) Save the second query as a MS Excel spreadsheet with the name: SBAC Importing MS Excel data to MS Access Launch MS Access from your computer Create New Database (with desired name and file location) Type File name and choose desired location by clicking on the yellow folder Once you have created a new database in MS Access Click on the External Data tab on the ribbon. Click the Excel icon from the ribbon in the Import & Link group You will be prompted to find your MS Excel file location. Navigate to the file location by clicking the Browse button. Select file and Click on the Open Button. Session 275 - Page 3
After selecting file click the OK button to begin data import into MS Access. We will import the data as is and not customize the fields or make any format changes. Click the Next button three times to continue to the final step where you are prompted to name your Table. Give the file an intuitive name like Student Demographic Data and Click the Finish button. There is no need to save the import procedures. Click the Close Button Repeat the import process for the second MS Excel File. Import the second MS Excel file to MS Access and name the table SBAC using MS Access Once you have imported both Query results into MS Access you should have two tables in your new database. (See picture below) Session 275 - Page 4
Select the Create tab on the ribbon and Click on the Query Design icon in the Queries group. A new blank query is created in MS Access and you are prompted to select the table you would like to include in your Query. Add the SBAC table by selecting it from the list of objects in the Tables Tab and Clicking the Add button. After adding the SBAC table Click the Close button to close the dialog box. Your database window will look like this. Session 275 - Page 5
To begin modifying this query, double click on the Student ID field inside of the SBAC table. This will add the field at the left most position of the query Repeat this step with the PerformLvl field. You will see the second field added to the query. Select the Query Tools Design tab on the ribbon. Then click on the Crosstab icon. The Crosstab button will change the query properties and will enable you to get All Test Scores on one line for each individual student. Note: that there are a few more steps to do before this query is complete. Select the top row in the third column and type in the following text exactly as it appears below. An explanation of the syntax will follow. Header: [Test Admin]&" "&[TESTID]&" "&[Test Title]&" PL" Session 275 - Page 6
Much like Aeries queries there are spaces between each of the symbols (i.e. &,,, [ ], etc.) Explanation: In a crosstab query MS Access displays all values that belong to a Student ID and displays them in one line. Because the SBAC table in our database contains SBAC, CST, CMA and CAPA results from both 2014-15 & 2015-16 we will use this query to list each type of result by Test Administration in a separate column. Syntax: When writing queries the Syntax is very important just like writing queries in Aeries we need to have spaces between each part. Header: [Test Admin] & " " & [TESTID] & " " & [Test Title] & " PL" In order to make it a little easier to see all the separate parts we ll add some color coding to describe the function of each item. Header: [Test Admin] & " " & [TESTID] & " " & [Test Title] & " PL" These are the separate parts of this query. (What do these symbols mean?) The word Header: is a place holder and will not be visible, but it helps us remember what this field is. Items inside of the green [square brackets] are field names (i.e. [Test Admin], [TESTID], [Test Title]) The red & is used to concatenate (join together) fields, spaces or text The " " (double quotes with a space in between) are used to add a space between two fields The " PL" is used to add a space and PL at the end of the field. This will indicate that the scores are Performance Level scores Next we will make changes to this query to determine where the fields will be listed in the crosstab query. Click in the Crosstab row in the Student ID column and select Row Heading from the drop down list. Then Click in the Crosstab row in the PerofmLvl column select Value from the drop down list, then Click the Total row in the PerformLvl column and select Max from the drop down list. Session 275 - Page 7
The last item to change is the header row. Click in the Crosstab row in the Header column and select Column Heading from the drop down list. Save your query by selecting File > Save Object as > (giving it the desired name. For this example we will use SBAC Crosstab PL as the query name. Click the OK button to complete the Save As command. To Run the Query - Select the Query Tools Design tab on the ribbon and Click on the Run Command. Now that we created the crosstab query that organizes our SBAC, CST, CMA and CAPA results we can combine them with our student demographic data. Joining Query results to analyze data - Creating a New query that combines results from more than one table. Select the Create tab on the ribbon and click on the Query Design icon in the Queries group. A new blank query is created in MS Access and you are prompted to select the tables or queries you would like to include in your Query. Add the Student Demographic Data table by selecting it from the list of objects in the Tables Tab and Clicking the Add button. Session 275 - Page 8
After adding the SBAC table Select the Queries Tab and Select the SBAC Crosstab PL Query and Click the Add button. We are only adding two objects to this query so we can close the dialog box. Click the Close button to close the dialog box. The Query window will now look like this. The Student ID fields in both tables need to be joined so that our results are matched to the correct students. (MS Access does this more efficiently than using MS Excel s Vlookup) Using your mouse Click on Student ID in the Student Demographic Data table And (without letting go of the left button) Drag your mouse to Student ID in the SBAC Crosstab PL table. A line linking both of these fields will appear like the one above. We want All student IDs to appear in the query results even if they do not contain any SBAC Results. To do this we need to modify the relationship we just created between both Student ID fields. Double click on the solid line that links both Student ID fields and the following dialog box will appear. Session 275 - Page 9
Be sure to Click the second radio button. This is the button that says Include ALL records from Student Demographic Data and only those records from SBAC Crosstab PL where the joined fields are equal. You will notice a change in the line. There will be a small arrow pointing from the Student Demographic Data table to the SBAC Crosstab PL table Now that a relationship has been established for these two tables we can add the fields we want to see for analysis. We can add the fields we want to see by double clicking on the field names we want to select. For this example we will double click on the following fields. School name, Grade, Student ID, Student Name, Sex, Description_LF, Description_HL, Description_ETH, Description_RC1, SPRG15 SBAC English Lang Arts Liter PL, SPRG16 SBAC English Lang Arts Liter PL, SPRG15 SBAC Mathematics and SPRG15 SBAC Mathematics. Your query screen will look something like this. Session 275 - Page 10
Save your query by selecting File > Save Object as > (giving it the desired name. For this example we will use Merged Data as the query name. Click the OK button to complete the Save As command. Then name your query To Run the Query - Select the Query Tools Design tab on the ribbon and Click on the Run Command. The query results will look like this. Using MS Excel to Analyze Data We will copy data directly from MS Access to a new MS Excel spreadsheet. After running the Merged Data query we worked on above, use the Select All option and Copy the query results. column. You can select all by clicking on the upper most cell just left of the first After selecting All from the Merged Data table Copy the data issuing the copy command. The Copy command can be accessed by Selecting the Home tab on the ribbon and Clicking the Copy icon After copying the query results, launch MS Excel from your computer. Session 275 - Page 11
You can paste the query results directly into the spreadsheet. By Selecting the Home tab on the ribbon and Clicking the Paste icon. After pasting the data your spreadsheet will look like this. Pivot tables are powerful tools for analyzing data. We can create a pivot table by selecting the Insert tab on the ribbon and Clicking the PivotTable button. the following dialog box will appear Ensure that your Table Range is correct and that the New Worksheet radio button is checked. Click the OK button to insert the pivot table to a new worksheet. On the right side of the new worksheets, all fields selected will display. To select the fields for the report, drag and drop them into Row and Column. Drag Fields into the boxes Session 275 - Page 12
The table being created will show to the left as the fields are added. To enhance the pivot we will insert a chart to graphically display the results. To insert a pivot chart. Select the pivot table first then, Select the PivotTableTools Options tab on the ribbon. Select the PivotChart button under the Tools category and the following dialog box will appear. Select the first icon on the top left under the Column chart group. A pivot chart will then appear next to your pivot table. The chart is linked to the pivot table and will update accordingly when changes are made to the pivot table. Lastly we will be using Slicers to filter our results. To insert slicers, Select the pivot table first then, Select the PivotTableTools Options tab on the ribbon. Session 275 - Page 13
Click on the Insert Slicer button on the ribbon and the following dialog box will appear. Select the following items and Click OK The screen print below shows what a few of the slicers look like. You can filter your pivot table and pivot chart by Clicking the items on the slicers. You are now ready to analyze your data using the Slicer (Filters) in your Excel Workbook. Session 275 - Page 14