How To Automate Part 2


Published on

A reference manual, on how to automate your work, from end to end.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

How To Automate Part 2

  1. 1. NetConsole data source
  2. 2. NetConsole timesheet data <ul><li>Sometimes your data source is not correct and you have to do your own calculations. </li></ul><ul><li>This is the case for my NetConsole data. </li></ul><ul><li>The solution was to copy/paste data for the year and compare it to the previous file and have access split out the differences and perform the calculations. </li></ul><ul><ul><li>Before Access, this was done by hand, in Excel. This lead to late nights and headaches. </li></ul></ul>
  3. 3. NetConsole timesheet data <ul><li>Run a report in NetConsole </li></ul><ul><li>Select Copy </li></ul><ul><li>Paste it into a blank excel tab. </li></ul>
  4. 4. NetConsole timesheet data <ul><li>Open the database and the All 1 st table. </li></ul>
  5. 5. NetConsole timesheet data <ul><li>Highlight all the data and hit the delete key. </li></ul><ul><ul><li>This deletes out old data and swaps in last check’s data. </li></ul></ul>
  6. 6. NetConsole timesheet data <ul><li>Copy the All 2 nd table. </li></ul>
  7. 7. NetConsole timesheet data <ul><li>And paste to the All 1 st table </li></ul><ul><li>Goto </li></ul><ul><ul><li>Edit </li></ul></ul><ul><ul><li>Paste Append </li></ul></ul>
  8. 8. NetConsole timesheet data <ul><li>Go back to All 2 nd and delete the data that was just copied. </li></ul>
  9. 9. NetConsole timesheet data <ul><li>Copy the excel data into Access </li></ul><ul><li>Select columns A thru J </li></ul><ul><li>Select Copy </li></ul>
  10. 10. NetConsole timesheet data <ul><li>Go back to All 2 nd </li></ul><ul><li>Select Paste Append </li></ul>
  11. 11. NetConsole timesheet data <ul><li>These are called drop-off tables (at least that is what I named them). </li></ul><ul><ul><li>These tables will be used to find the differences since the last run of the NetConsole report. </li></ul></ul><ul><ul><li>The differences are going to be the new pay weeks on the upcoming check and any prior week approvals or disapprovals since the last run of the report. </li></ul></ul><ul><li>The two data sources (old file and new file) are turned into a new data source which dictates what employees get paid. </li></ul>
  12. 12. Queries
  13. 13. Why Queries <ul><li>Queries are great for manipulating data and turns manually work in excel into simple clicks in Access. I use them for two main purposes. </li></ul><ul><li>If there are two or more tables and you want to combine the data. </li></ul><ul><ul><li>Queries make it easy by linking common denominators (SS #, Names, Dept #s, etc). </li></ul></ul><ul><ul><li>Linking tables is like using Vlookup in Excel, be much easier. There is never a need to update a formula or range when new data is added. </li></ul></ul><ul><li>For simple and complex formulas. </li></ul><ul><ul><li>The formula is at one point (the header) instead of several rows and columns that constantly need to be updated. </li></ul></ul>
  14. 14. Making Access Queries
  15. 15. Making Queries Select Create query
  16. 16. Making Queries Select the Tables and Queries that you want data from.
  17. 17. Making Queries Each table/query will be displayed as a separate box
  18. 18. Making Queries Pick up a common denominator and drag it to its counter part. A line will link the two together.
  19. 19. Making Queries Double click on the line and select the second option.
  20. 20. Making Queries Double click on the header rows to add them to the query
  21. 21. 401(k) queries
  22. 22. 401(k) queries <ul><li>I have several tables I update that have different types of data. </li></ul><ul><li>These tables will be linked together in queries to provide different types of information. </li></ul>
  23. 23. 401(k) queries <ul><li>This is the Earning Code Range table. </li></ul><ul><li>It contains all of the earning codes, per check date, per employee. </li></ul><ul><ul><li>Big problem is that there is a row for each earning code. You can’t do calculations on data like this. </li></ul></ul><ul><li>My final goal is to get all earning codes into column headers </li></ul><ul><ul><li>Then calculations can be performed on them via my queries or my pivots. </li></ul></ul>
  24. 24. 401(k) queries <ul><li>A series of queries based off of the earnings code table, were created. </li></ul><ul><li>These queries represent a single earning code. </li></ul><ul><li>On of them is earning code 17. </li></ul>
  25. 25. 401(k) queries <ul><li>The query is made up of all of the headers from the earnings table. </li></ul><ul><li>There is one difference. </li></ul><ul><li>It is filtered for code 17. </li></ul><ul><ul><li>Simply type the number 17 on the Criteria for that header. </li></ul></ul>
  26. 26. 401(k) queries <ul><li>This query only has the earning code 17. </li></ul><ul><li>This is done with each earning and deduction code. </li></ul><ul><ul><li>Then they are brought together through another series of queries. </li></ul></ul><ul><li>This is example of how queries can narrow a range of data. </li></ul>
  27. 27. 401(k) queries <ul><li>The earning codes are linked together and added as new headers to the master query. </li></ul><ul><li>Try not to link more then 10 tables at a time. </li></ul><ul><ul><li>Linking too many tables at one time kills performance (5 minute wait times). </li></ul></ul><ul><ul><li>Making 10 queries (building upon each other) with 10 tables linked to each improves the performance (almost instant opening). </li></ul></ul>
  28. 28. 401(k) queries <ul><li>The links are done by 4 common denominators; </li></ul><ul><ul><li>Checkdate, SS #, Check # & Dist#. </li></ul></ul><ul><li>Use a main table to link back the queries. </li></ul><ul><ul><li>When the query is opened, the row count should always be the count of the main table. </li></ul></ul><ul><li>The line are linked with the number 2 link. It drops off data that is not present on the main table </li></ul>
  29. 29. 401(k) queries <ul><li>The purpose of this linking of queries is to get the earning code header on a column (so formulas can be applied). </li></ul><ul><li>Once linked, double click on earnings amount and it creates a header for that amount. </li></ul>
  30. 30. 401(k) queries <ul><li>Each Earnings code now has its own header by employee, check date, etc. </li></ul><ul><li>Simple to complex calculations can be performed </li></ul><ul><ul><li>E18 Shift2 + E19 Shift 2 = Total Shift </li></ul></ul><ul><ul><li>Or all of the earnings codes = Total Wages </li></ul></ul><ul><li>I have a spreadsheet that uses this query to create a mock W-2 for each employee and summarized for easy balancing. </li></ul><ul><li>Very powerful tool, that once set-up, saves tons of time. </li></ul>
  31. 31. 401(k) queries <ul><li>The final query has all of the deduction codes, earning codes, taxes and memo codes on one row </li></ul><ul><ul><li>Per person </li></ul></ul><ul><ul><li>Per check date </li></ul></ul><ul><ul><li>Per check # </li></ul></ul><ul><ul><li>Per dist # </li></ul></ul><ul><li>This query is one stop shopping for a ton of pivot tables and analysis. </li></ul>
  32. 32. 401(k) queries <ul><li>For the 401(k) spreadsheet the master query ( everything ) is used </li></ul><ul><li>Make a new query </li></ul><ul><li>Add formula headers. </li></ul>
  33. 33. 401(k) queries <ul><li>In Queries you are merging data which generates a lot of blank cells. </li></ul><ul><li>Blank cells can not be calculated in Access unless you use this special formula (there are others but they don’t link into excel). </li></ul><ul><ul><li>IIf(IsNull(“header name”),0,”header name”) + the same formula for a different header name. </li></ul></ul>
  34. 34. 401(k) queries <ul><li>Just like Excel, Access has a line limit, for formulas. </li></ul><ul><li>I had to do 3 separate formulas and then a final “Totals” formula (adding them 3 up). </li></ul><ul><li>This formula was for earning codes that make eligible earnings for 401(k) (what our deduction % is calculating from). </li></ul>
  35. 35. 401(k) queries <ul><li>This is a balancing formula between the new “Total” and an ADP memo code that is suppose to being doing the same calc. </li></ul><ul><li>This is an audit feature that is automatically applied to all employees and can be summarized on a pivot table. </li></ul><ul><ul><li>No more spot checking, this does everyone at once, instantly. </li></ul></ul>
  36. 36. 401(k) queries <ul><li>This formula mimics the formula ADP uses for our 401(k) match </li></ul><ul><li>A comparison ensures that ADP is doing the correct calc. </li></ul><ul><li>Access has the same formulas as Excel. </li></ul><ul><ul><li>Just a little different with an “IIf” instead of “IF”, and using tables instead of cells. </li></ul></ul><ul><ul><li>No copying and pasting of formulas. These are applied to all records. </li></ul></ul>
  37. 37. 401(k) queries <ul><li>This is the raw data of the query. </li></ul><ul><li>You go between the data and the design by hitting this icon </li></ul>
  38. 38. 401(k) queries <ul><li>For ease of use, pivot tables are then linked, to the query. </li></ul><ul><li>You never have to open the Access query again. </li></ul><ul><li>You only need to open excel and allow it to update. </li></ul><ul><li>Then you can analyze your data. </li></ul>
  39. 39. NetConsole Queries
  40. 40. NetConsole queries <ul><li>A series of queries are needed in order to get the correct data for payout. </li></ul>
  41. 41. NetConsole queries <ul><li>It was started by making the individual hour code queries. </li></ul><ul><li>This was to get the codes out of rows and make them headers. </li></ul><ul><ul><li>This was done for both tables </li></ul></ul>
  42. 42. NetConsole queries <ul><li>Drop off queries were made with the new hour code queries and a formula for the true amount to be paid. </li></ul><ul><li>By starting with 2 nd E (which is created from the new report data) there is a drop off of any people that don’t match with the 1 st </li></ul><ul><ul><li>This would include terminations </li></ul></ul>
  43. 43. NetConsole queries <ul><li>The IsNull formula is used in order to do calculations on blank cells and so it can be linked into Excel. </li></ul><ul><li>Then there is a simple subtraction . </li></ul><ul><li>This is subtracting what the Old YTD hours (for code E) were from the new YTD hours. </li></ul><ul><ul><li>The difference will be what has been approved for the new pay period or new approvals for past weeks. </li></ul></ul>
  44. 44. NetConsole queries <ul><li>Column Header E is the new Excused hour totals of the pay period. </li></ul><ul><li>This set up takes a bit of time, but once set up it never needs to be changed. </li></ul><ul><li>When I would do the same thing in Excel, it was a lot of copying and pasting and then a lot of formulas. </li></ul><ul><ul><li>This had to be done every paycheck, the same monotonous time consuming procedure. </li></ul></ul><ul><ul><li>The Access queries automate the work and make it instant. </li></ul></ul>
  45. 45. NetConsole queries <ul><li>The master query (Reg Total) combines of all the hour code queries and adds some final formulas. </li></ul><ul><li>This query will be linked into my spreadsheet as both an Excel query (column form) and a pivot table. </li></ul>
  46. 46. NetConsole queries <ul><li>This formula figures out what regular hours should be paid. It takes the standard 86.67 hours and subtracts personal leave hours. </li></ul><ul><ul><li>The result is an employee get paid personal hours (previous headers) and the rest is paid as regular hours. </li></ul></ul><ul><ul><li>There is also an exception person that gets paid 56 hours that need to be taken into account. </li></ul></ul>
  47. 47. NetConsole queries <ul><li>This formula and the corresponding Criteria drops off any person that has no Personal or OT (in various forms) hours. </li></ul><ul><ul><li>There are a lot of duplicate or unnecessary row of data without this formula. </li></ul></ul>
  48. 48. NetConsole queries <ul><li>The query is then linked into my pivot table for summary data. </li></ul><ul><ul><li>This is compared to ADP once the data is imported for a balance. </li></ul></ul>
  49. 49. Pivot Tables
  50. 50. Pivot Tables <ul><li>Pivot Tables are one of the more useful inventions to come out of Microsoft. </li></ul><ul><ul><li>It goes back to Lotus 1 2 3 </li></ul></ul><ul><ul><li>But has never really caught on. </li></ul></ul><ul><li>I use it as </li></ul><ul><ul><li>A data Hub (grabbing data from a variety of sources) </li></ul></ul><ul><ul><li>A massive filter, to easily find and view data. </li></ul></ul><ul><ul><li>Summary of Data </li></ul></ul><ul><ul><li>Calculations </li></ul></ul><ul><ul><ul><li>Audits </li></ul></ul></ul><ul><ul><ul><li>Totals </li></ul></ul></ul><ul><ul><ul><li>Problem indicators </li></ul></ul></ul>
  51. 51. Linking Pivot Tables to Access Queries
  52. 52. Connecting Pivot Tables Select; Data Pivot Table
  53. 53. Connecting Pivot Tables Select External data source
  54. 54. Connecting Pivot Tables Select Get Data
  55. 55. Connecting Pivot Tables Select MS Access
  56. 56. Connecting Pivot Tables Navigate to the database folder and select it.
  57. 57. Connecting Pivot Tables Navigate to the query and select all or a selection of headers you need.
  58. 58. Connecting Pivot Tables Click Next
  59. 59. Connecting Pivot Tables Select Next
  60. 60. Connecting Pivot Tables Select Finish
  61. 61. Connecting Pivot Tables Select Next
  62. 62. Connecting Pivot Tables Select Layout
  63. 63. Connecting Pivot Tables Drag and Drop headers into appropriate spots
  64. 64. Connecting Pivot Tables <ul><li>The data is ready for analysis </li></ul>
  65. 65. Grouping Pivot Tables <ul><li>To Group </li></ul><ul><li>CTRL click on each entry </li></ul><ul><li>Right click (for menu display) </li></ul><ul><li>Select Group and Show Detail </li></ul><ul><li>Select Group </li></ul><ul><li>If I have an Access source I usually create a new header in the query and skip doing it on the pivot. </li></ul>
  66. 66. Grouping Pivot Tables <ul><li>Overwrite generated group name to anything you want </li></ul>
  67. 67. Formulas in Pivot Tables <ul><li>For Formulas </li></ul><ul><li>Select pull down list </li></ul><ul><li>Formulas </li></ul><ul><li>Calculated Field </li></ul>
  68. 68. Formulas in Pivot Tables <ul><li>Name you header under Name </li></ul><ul><li>Under formula select your header fields and apply calculations. </li></ul>
  69. 69. 401(k) Pivot Tables
  70. 70. 401(k) Pivot Tables <ul><li>Link the pivot table to the 401(k) query. </li></ul><ul><li>Select the query and all of the headers </li></ul>
  71. 71. 401(k) Pivot Tables <ul><li>Add the earning and formula headers into the data section. </li></ul><ul><li>Rename them and changed them from count to sum. </li></ul><ul><ul><li>Click on a header and type over the Name and select sum. </li></ul></ul><ul><li>I needed to do this because the header name contains the query and table name, which makes it huge. </li></ul>
  72. 72. 401(k) Pivot Tables <ul><li>Most formulas you can do in Access but some you can’t. </li></ul><ul><li>I needed to do this on the pivot table because the calculation needed to be off of summed data that was per check date, per employee. </li></ul><ul><li>The Access query had more factors, which made the calculation incorrect. </li></ul>
  73. 73. 401(k) Pivot Tables <ul><li>These calculations are part of the auditing. </li></ul><ul><li>This tab is an audit per employee, per check date. </li></ul><ul><li>This is audited every paycheck to make sure the %’s are solid and the Diffs are zero. </li></ul>
  74. 74. 401(k) Pivot Tables <ul><li>The initial pivot table tab is copied to this one. This allowed different auditing techniques to be performed. </li></ul><ul><li>This is tab 1 of 3 tabs to audit the YTD 401(k) eligible earnings. </li></ul><ul><li>This tab is a summed YTD calculation for the earnings (one of the formulas on my query). </li></ul>
  75. 75. 401(k) Pivot Tables <ul><li>This is a pivot table linked to a separate Access query. </li></ul><ul><li>It is an accumulator that ADP updates each check. </li></ul><ul><li>This is to make sure their number matches mine. </li></ul><ul><li>The two queries could not be combined because this query data is a lumped summed, while the other data is separated by check date and other headers. </li></ul><ul><ul><li>This is difference between 600 rows of data and 9000 rows of data. </li></ul></ul>
  76. 76. 401(k) Pivot Tables <ul><li>The 3 rd tab does the balancing. </li></ul><ul><li>There are formulas that point to each pivot table (which are both sorted by SS) </li></ul><ul><li>Then a simple subtraction formula illustrates any differences. </li></ul><ul><li>A filter is installed for easy of finding differences </li></ul><ul><ul><li>Does not equal 0. </li></ul></ul>
  77. 77. 401(k) Pivot Tables <ul><li>This pivot table is a summary balance that I can print and compare to the file I upload on Mass Mutual’s (our 401k vendor) website. </li></ul><ul><ul><li>Same data as the 1 st pivot but no employees on the pivot, just summarized data and balances. </li></ul></ul>
  78. 78. Lambda Pivots
  79. 79. Lambda Pivots <ul><li>Lambda source data is copied into the spreadsheet so need to link anywhere. </li></ul><ul><li>A macro puts the data into correct format for the pivot tables. </li></ul><ul><li>This is just your basic pivot table functionality. </li></ul>
  80. 80. Lambda Pivots <ul><li>The pivot reads columns A through E </li></ul>
  81. 81. Lambda Pivots <ul><li>There are two pivot tables linked to the data. </li></ul><ul><li>This one illustrates employees hours by Month </li></ul>
  82. 82. Lambda Pivots <ul><li>Simple data needed. </li></ul><ul><li>Just a couple of headers needed and no calculations or queries. </li></ul><ul><li>What made this project hard, was getting the data to the point where it could be viewed in a pivot (macros) . </li></ul>
  83. 83. Lambda Pivots <ul><li>This one illustrates the account code’s hours per month. </li></ul><ul><li>To make the charts, it was a simple as hitting a button. </li></ul>
  84. 84. Lambda Pivots <ul><li>That button automatically created this chart. </li></ul><ul><li>Once things are set up, there is no need to touch anything again. </li></ul>
  85. 85. Creating External Queries in Excel
  86. 86. External Queries <ul><li>Initial setup of external queries are similar to pivot tables. </li></ul><ul><li>Goto </li></ul><ul><ul><li>Data </li></ul></ul><ul><ul><li>Import External Data </li></ul></ul><ul><ul><li>New Database Query </li></ul></ul>
  87. 87. External Queries <ul><li>Select Access </li></ul>
  88. 88. External Queries Navigate to where the database is located.
  89. 89. External Queries External queries simply list the data from headers selected.
  90. 90. NetConsole Excel query
  91. 91. NetConsole Excel queries <ul><li>Instead of a pivot, the data is brought in as a query. </li></ul><ul><li>It is linked in, to the Access Query Reg Totals, just like with a pivot. </li></ul><ul><li>Instead of a pivot calc, you can put in formulas, like a normal spreadsheet. </li></ul>
  92. 92. NetConsole Excel queries <ul><li>In order for you formulas to auto fill, you need to edit the query. </li></ul><ul><li>Right click on the body and select Edit Query. </li></ul>
  93. 93. NetConsole Excel queries <ul><li>Click on Fill down, to have you formulas auto fill in new cells, upon refreshing. </li></ul><ul><li>To update the spreadsheet upon opening, click on Refresh data. </li></ul>
  94. 94. NetConsole Excel queries <ul><li>This tab put the data into the format I needed for an upload into ADP. </li></ul><ul><li>This is done by formulas pointing to the query and by filters hiding non relevant rows. </li></ul>
  95. 95. NetConsole Excel queries <ul><li>Certain columns are filtered by </li></ul><ul><ul><li>Does Not Equal 0 </li></ul></ul><ul><li>There are a lot of blank rows that get hidden out of view. </li></ul><ul><li>This is done manually each pay check, but a macro could be set up to do this automatically, upon opening. </li></ul>
  96. 96. NetConsole Excel queries <ul><li>A pivot table is linked to the access query </li></ul><ul><ul><li>Balances </li></ul></ul><ul><ul><li>Troubleshoots any problems. </li></ul></ul>