ACL IN PRACTICE - California State University, Northridge

Transcription

ACL IN PRACTICE

ACL IN PRACTICE

Copyright 2006 ACL Services Ltd.All rights reserved.No part of these materials may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means (photocopying, electronic, mechanical, recording, or otherwise), without permission in writing from the publisher, except by a reviewerwho may quote brief passages in a review.These materials may not contain all the information, or the most current information relevant to your situation or intended application. Support and update services are available from ACL, separately.ACL 9August 2006ACL Services Ltd.1550 Alberni StreetVancouver, BCCanada V6G 1A5Telephone: 1-604-669-4225E-mail: info@acl.comWeb: www.acl.comPrinted in CanadaACL, ACL Data you can trust. Results you can see, the ACL logo and Audit Command Language are trademarks or registeredtrademarks of ACL Services Ltd.Microsoft, Windows and Windows Server are trademarks or registered trademarks of Microsoft Corporation. AIX, OS/390,OS/400 and z/OS are registered trademarks of IBM Corporation. Linux is a registered trademark of Linus Torvalds. SAP, R/2 andR/3 are trademarks or registered trademarks of SAP AG. Crystal Reports is a trademark or registered trademark of BusinessObjects SA. All other trademarks are the property of their respective owners.200607060941

C ONTENTSChapter 1: Introducing Metaphor Corporation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Tutorial objectives . 2About Metaphor Corporation . 3Metaphor credit card policies . 4Acceptable category codes . 5Metaphor data files . 5Plan your analysis . 6Preliminary investigation . 6General tips to consider . 7Chapter review . 8Chapter 2: Examine employee data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Examine the employee list . 10Open and view the employee data project . 10Get a statistical picture . 11Look for duplicate records . 13Examine employee salaries and bonuses . 14Find total bonuses paid in 2002 . 15View salaries in descending and ascending order . 15View employees hired in 2002 . 16Determine bonus as a percentage of salary . 17Exercises . 18Chapter review . 19Chapter 3: Set up your project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Start your project in ACL . 22Create a project in ACL . 22Import your data files as tables . 23Exercise . 26Check and verify the data . 27Check the data type and format . 27iii

Verify the data in a table .Document your work .Add record notes to a table .Exercise .Chapter review .2930313132Chapter 4: Begin Your Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Determine the total liability .Extract expiring card numbers .Find transactions by customer number .Check the credit card balances .Exercises .Chapter review .33343435373939Chapter 5: Examine expense patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Find the total expenses for each category code .Summarize the total expenses for each category .Isolate transactions by category .Isolate particular recreational expenses .Exercises .List the amounts for each card number .Exercise .Chapter review .414242434546464748Chapter 6: Analyze transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Determine which transactions are unacceptable .About the Join and Relations commands .Check the code tables for obvious errors .Identify unacceptable transactions .Identify the employees .Identify the employees’ departments .Create a list of employees .Report your findings .Exercises .49505051535657596162iv

Chapter review . 62Chapter 7: Validate, correct, and extract data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63Import the May transaction data . 64Use folders to organize your project . 64Import transaction data for May 2003 . 65Compare and correct the table layouts . 66Combine and verify the tables . 67Combine the May transaction tables . 67Verify the new table . 68Check the combined table for duplicates . 69Exercises . 69Isolate and correct validity errors . 70Check the format of card numbers . 70Create a 16-digit card number field . 71Extract the corrected records to a new table . 72Export the combined transaction table to Excel . 73Create an error-free employee record table . 73Exercises . 74Ideas for further analysis . 74Chapter review . 75v

vi

C HAPTER 1I NTRODUCING M ETAPHOR C ORPORATION1Experiment with real-world data analysis scenariosIn this chapter Review the tutorial objectivesAbout Metaphor CorporationLook at your filesPlan your projectACL in Practice is a tutorial that examines human resources records andcredit card transactions at a fictional company, Metaphor Corporation. Asyou work through the procedures and examples, you learn to apply ACL’sanalysis and reporting capabilities to real-world data. When you finish, youwill be able to apply the power of ACL to your own data.1

Chapter 1: Introducing Metaphor Corporation Tutorial objectivesIn this tutorial you will: Work with an existing data analysis projectCreate and work with a new ACL project fromstart to finish Report results of your ACL project Export the results to another file formatThese steps are typical for many data analysis projectsthat you perform in ACL, both small and large.Chapter 4: “Begin Your Analysis”Objective: Determine basic background informationabout the credit card numbers and transactions.Summary: Chapter 2: “Examine employee data” Objective: Examine employee profile data for MetaphorCorporation.Summary: Examine the project and its contents Create a statistical overview Examine employee bonuses and salaries 2 Verify the data. Document your work.Determine some basic information about thecredit card balances.Summary: Create an ACL project.Import the data into your project. Each datasource is a separate table in the ACL project.Find which transactions are linked to a particularcustomer.Objective: Find information about itemization ofexpenses and spending patterns.Chapter 3: “Set up your project”Summary:Determine which credit card numbers are due toexpire within a given time period, and extract thisinformation.Chapter 5: “Examine expense patterns” Objective: Create the project and add the data.Determine the total credit limit exposure of thecompany. Determine transactions per merchant categorycode.Separate the transactions for airfare, hotel stays,or rental cars.Determine expenses for drinking establishmentsand golf courses.Determine total transaction amounts per creditcard number.Determine transaction amounts per customercode.ACL in Practice

About Metaphor CorporationChapter 6: “Analyze transactions”Objective: Determine whether transactions areacceptable, unacceptable, or require approval.Summary: Determine which transactions are unacceptable,and which employees made these transactions.Create a report that includes employees withunacceptable transactions, details of thetransactions, and the employees’ departments.Chapter 7: “Validate, correct, and extract data” About Metaphor CorporationSince 1995, Metaphor has sold software and IT services.Metaphor has several dozen consultants who are full-timeemployees. These consultants work out of Metaphor’shead office and they also travel the world in order toinstall software, provide training courses, and initiate andmaintain sales relationships.Metaphor also has administrative and professional staffmembers in the head office. In addition, Metaphor hassales agents in various locations around the world whoare not employees.Objective: Expand your analysis to include more datafiles.Summary: This portion of the tutorial extends theMetaphor Corporation scenario. ACL in PracticeImport the May 2003 credit card transaction filesas tables.Clean up the data in the May 2003 credit cardtransaction tables.Extract the repaired data to new tables.Combine the two May 2003 credit cardtransaction tables into one.Using the techniques you have learned, analyzethe May 2003 credit card transactions.3

Chapter 1: Introducing Metaphor CorporationMetaphor credit card policiesMost employees have a company credit card. When anemployee purchases products or services for thecompany, he or she must use a company credit card.Employees entertain clients and prospective clients asappropriate, both in Metaphor’s home city and whiletravelling. They are also responsible for their ownprofessional development, and are expected to chargeexpenses to the company credit card for courses, books,journal subscriptions, and professional memberships.Some employees are also responsible for purchasingsupplies for the office.Thus, Metaphor Corporation incurs significant expensesin several categories:By using ACL to analyze the credit card transactions ofMetaphor employees, you can find transactions that arecontrary to policy and transactions that might beerroneous or fraudulent.The following table shows allowable expenses.TravelEntertainmentOffice andprofessionalAirfareRestaurantsHotelDrinking placesDues formembership clubsTaxiBoatcharters/rentalsRestaurantsRental carsLong-distance busticketsCaterersBakeriesDues forprofessionalorganizationsDues for fraternalorganizations Travel Entertainment Client service Professional developmentAmusement parksComputers,computer parts, andsoftware Internal office expensesGolf coursesOffice suppliesMetaphor’s policy is that all purchases must be assignedto a customer number. Although most of the customernumbers correspond to external clients, customernumbers that start with zero correspond to internaldepartments.Travel agenciesToll and bridge feesSporting eventsRecreationalservicesBooks andperiodicalsTourist attractionsTheater ticketsTour busesMusiciansBowling alleysEmployees are aware that certain categories oftransactions are unacceptable. For example, employeesmust not use corporate credit cards for gambling.Although the company sometimes approves transactionsin other categories, permission must be granted inadvance. Some categories are prohibited entirely.4ACL in Practice

About Metaphor CorporationAcceptable category codesThe credit card analysis in this tutorial relies on theMerchant Category Code list, which is used by majorcredit card providers. It contains thousands of four-digitnumeric codes, including unique codes for many majorairlines and hotel chains, and numerous generic codes.Every credit card transaction has an accompanyingcategory code assigned to it.Metaphor data filesWhen you perform an analysis for your own company,you often obtain the data in whatever file format isavailable. In this tutorial, however, you continue ananalysis project that has already been planned. Much ofthe preliminary work is already complete.For this analysis project, you use these files: In the real world, credit card companies occasionallyassign incorrect codes, so if you obtain questionableresults, contact the merchant for verification. For the purposes of this analysis, you can comparetransaction codes to the lists of acceptable andunacceptable codes. For example, if a Metaphoremployee uses his credit card to gamble, the transactioncode indicates an unacceptable transaction. The Policies.doc document, which accompanies thetutorial data, discusses appropriate credit card usagepolicies. The data analyst uses this document todetermine what types of transactions to flag. ACL in PracticeAcceptable Codes.mdbThis Access database file has a list of acceptablecodes from the Merchant Category Code list.Credit Cards Metaphor.xlsThis Excel worksheet lists credit card information.Company Departments.txtThis tab-delimited file contains a list ofdepartments and their internal numbers.Employees.cvsThis comma-delimited text file lists the employeenames, employee numbers, and credit cardnumbers.Trans April.xlsThis Excel worksheet lists the credit cardtransactions for April 2003.Unacceptable Codes.txtThis tab-delimited text file contains a list ofunacceptable codes from the Merchant CategoryCode list.5

Chapter 1: Introducing Metaphor Corporation Plan your analysisDeveloping an analytical strategy is typically an iterativeprocess. As you work with the data in ACL, some patternswill likely become apparent, which might lead to newstrategies. Here is a typical cycle: Plan the analysis Analyze the data Reconsider the analysis Analyze the data againAs you develop and work through your analysis, youmight decide that you need additional data. For example,you use hire date and salary information in your analysis,but once you assemble preliminary results, you decide toacquire employee absence records. You can always addmore data to your project, but obtain as much raw data asyou can before you begin your analysis.Preliminary investigationBecause the tutorial includes ready-made data, you do nothave to perform any preliminary investigation of the data.In general, however, you should investigate the data youwant to use before you proceed.Consider these questions: Who entered the data? Who maintains the data? Which department owns this data? An ACL analysis involves a project that contains one ormore tables. These tables are imported from external datasources, such as Excel worksheets, Access databases, textfiles, Oracle databases, and so forth. In a typicalcorporation, various departments store and assembledata on a daily basis. You can use ACL to combine datafrom disparate sources to create a single coherentanalysis.Once you have your data in place, you can developobjectives for your analysis. Consider some possibleapproaches. Make a note of tests that you think might beuseful.What data currently exists, and what format is itin?Is the data accurate and properly formatted? Ifnot, can the data be modified to make it suitable?Can you combine the data from more than onesource?Can you derive the data you need from the datayou already have?Before you import a file into your project, look at the filein its original format. For example, you can open aMicrosoft Excel worksheet to see what it looks like, oryou can open a text file in Notepad.In a large file, such as a database that contains millions ofrecords, it might be impractical to look at the data in itsoriginal format. In that case, you can ask your ISdepartment for a description of the fields and the fieldsizes. If possible, review an excerpt of the file to get abetter understanding of its content.For example, if you want to analyze some aspects ofcustomer invoices over the period 1999 to 2002, the datamight exist in a comprehensive database that is in a form6ACL in Practice

Plan your analysisthat is not easily accessible. You could ask your ISdepartment for information about specific fields, whichmight look like this:FieldCommentsCompany Name30 characters, TextAmount12 characters, TextDate of Invoice10 characters, Date,DD/MM/YYYYDate Payment10 characters, Date,MM/DD/YYYYWith this type of information, you know in advance howthe data appears. For example, you know that the two datefields are formatted differently.Although ACL is capable of handling difficult data, youcan make the process easier for yourself by ensuring thatyour data is clean.ACL in PracticeGeneral tips to considerConsider the following steps when you begin to organizea new project. Refine your strategy with test data. There is littleneed to restrict yourself to using data samplesbecause ACL can read data files of any size.However, small extracts of data might be usefulwhen you are developing an analytical strategy.For example, you can look at one day’s worth ofdata before you analyze five year’s worth. Workingwith a thousand-record file is much quicker thanworking with a million-record file. When you haveyour strategy in place, you can apply it to amillion-record file. Eliminate errors from your data. The quality ofyour analysis will improve with the quality of yourdata. Try to eliminate any errors from your databefore bringing it into ACL. If that is not possible,you can use ACL to correct the data.Experiment with your data. If you aren’t sure ofwhat an ACL function or command will do, youcan try it anyway. Your data remains unharmed.7

Chapter 1: Introducing Metaphor Corporation Chapter reviewIn this chapter you learned:8 The tutorial objectives. The Metaphor credit card policy. How to plan a typical ACL project.ACL in Practice

C HAPTER 2E XAMINE EMPLOYEE DATA2Analyze salaries, bonuses, and hiring datesIn this chapter Examine the employee listExamine salaries and bonusesIn this chapter, you look at some Metaphor Corporation employee profiledata. You analyze salaries, bonuses, hiring dates, and other human resourcesinformation. In the course of this analysis, you learn the basics of ACL,practice navigating the program, and analyze data.In this scenario, you take over an ACL project from a coworker who hasalready started work on it. You analyze the data that your coworkerassembled.9

Chapter 2: Examine employee data Examine the employee listWhen you look at the employee data, you can get someideas about how you might analyze this data. In thisexample, the project has already been assembled for you.When you work with your own projects, you decide whatdata to include. You can also add more data at any time toan existing project.Your task is to determine various financial and humanresource information, based on the data in your ACLproject.The project you work with in this chapter represents asmall-scale, but fairly typical data analysis project. Thisproject has two tables that contain information aboutMetaphor employees. You perform the analysis based onthis information.As you work through the tutorial, you might notice that thecolumns on your screen sometimes appear in a different orderfrom the columns in the illustrations. To change the order of acolumn, click the field list heading in the dialog box with whichyou are working.TasksView the employee data project.Get a statistical picture.Check for duplicate employee records.10Open and view the employee data projectYou begin your examination of the employee data byviewing the contents of the project.An ACL project is a holder for data that you import intoACL as tables. Once the data is imported into the project,it does not matter to ACL what the original data sourcewas.When you use ACL, you either create a new project towork with, or you open an existing project. You open,save, and close projects in ACL in much the same way thatyou manage documents in other Windows programs.! Open the employee data project1 Open ACL.2 Select File » Open Project. Browse to locate theC:\ACL Data\Sample Data Files folder. SelectMetaphor Employee Data. Click Open.If your installation of ACL did not use the default folders, this filemay be located elsewhere on your system.Notice that the Project Navigator pane is at the left of thewindow, and the table view is at the right. On theOverview tab, you can access the tables, scripts, and log.In this project there are two tables: Agents Metaphorand Employee List. The Agents Metaphor table lists allof Metaphor’s independent sales agents around theworld. The Employee List lists all of the Metaphoremployees at the head office.ACL in Practice

Examine the employee list! View the contents of the employee data project1 In the Overview, right-clickMetaphor Employee Data.ACL and selectProperties. Click the Notes tab.Although this project contains no notes, you can addthem at any time to record details of your work.2 Close the Project Properties dialog box.3 Double-click Agents Metaphor in the Overview toopen the table.Get a statistical pictureThe Statistics and Profile commands give you a quickstatistical snapshot. With larger tables, the informationthat you can get from Statistics and Profile is often useful.The Statistics command works with numeric and datefields. Profile works with numeric fields only.In this procedure, you generate statistics about theEmployee List table, such as ranges of hiring dates andsalaries.4 Select Analyze » Count Records. The Count dialogbox appears. Click OK.The count of 41 records appears at the bottom of yourscreen. Although you cannot see a difference on thescreen, ACL wrote the information to the log.! Generate statistics on the employee list1 With the Employee List table active, select Analyze »Statistical » Statistics. The Statistics dialog boxappears.5 Open the Employee List table. Count the number ofemployees. How many employees are there? Youshould get 200.Before you run a command in ACL, ensure that no column inthe view is selected. Otherwise, ACL will run the command onjust the selected field.ACL in Practice11

Chapter 2: Examine employee data2 Click the Statistics On button. The Selected Fieldsdialog box appears. Click Add All.If you prefer, you can run the Statistics command on eachfield separately, so that you see the results separately.The Profile command also gives you an overview of thedata that is more concise than that provided by Statistics.! Use Profile to get information about a table1 With the Employee List table active, select Analyze» Statistical » Profile. The Profile dialog boxappears.3 Click OK.On the Output tab, ensure that Screen isselected, Click OK. ACL displays the results.2 Select all of the fields and click OK. ACL displays theresults.If you scroll down, you can see that the earliest hiring dateis 01/05/1995 and the latest hiring date is 12/19/2002.Some of the information provided is not useful, such asthe total of the HireDate field values, so you candisregard this information.12Each of the values for each of the numeric table columnsis shown on the tab.ACL in Practice

Examine the employee listLook for duplicate recordsOne way to ensure the integrity of the data is to check forduplicate records.This might be a more complicated task than it seems atfirst glance. One employee might be listed under twonames, or under the same name twice. Two employeesmight have been assigned the same employee numberinadvertently. The type of duplicates you want to checkdepends on the data that you are working with.Although you are checking for duplicates in only onefield, include all of the fields in the output screen tohelp you to interpret the results.4 On the Output tab, select Screen. Click OK.ACL displays the results.In the next procedures, you check for duplicates on theemployee last name and the employee number.! Look for duplicate last names1 With the Employee List table active, select Analyze »Look for Duplicates. The Duplicates dialog boxappears.5 In the Last Name column, click a hyperlink. ACLdisplays a filtered view of the Employee List,showing that employee’s details.You next decide to check the Employee List todetermine whether there are any duplicate employeenumbers.! Look for duplicate employee numbers2 Click Duplicates On. The Selected Fields dialog boxappears. Click Last Name and click the arrow button.Click OK.3 Click the List Fields button. The Selected Fieldsdialog box appears. Click the Add All button. ClickOK.ACL in Practice1 Click the Remove Filterbutton to remove the filter.The full Employee List table appears again.2 Select Analyze » Look for Duplicates. TheDuplicates dialog box appears.3 Click Duplicates On. The Selected Fields dialog boxappears. Select EmpNo and click the arrow button.Click OK.13

Chapter 2: Examine employee data4 On the Output tab, select Screen. Click OK.5 View the Duplicat

Examine the project and its contents Create a statistical overview Examine employee bonuses and salaries Chapter 3: "Set up your project" Objective: Create the project and add the data. Summary: Create an ACL project. Import the data into your project. Each data source is a separate table in the ACL project. Verify the data.