Showing posts with label Intro Series PQ. Show all posts
Showing posts with label Intro Series PQ. Show all posts

What's killing My Excel?


Across the globe, Excel crashing is an accountant or analyst's bane. I've been there and know how exhausting it can be.  Fortunately (knock on wood), I've found some tips which have virtually eliminated crashing for me.  
  • Get 64-bit Excel
  • Disable add-ins
  • Prioritize Excel
  • Check your resource monitor


Get 64-bit Excel

The #1 way to fix Excel crashing issues is to install the 64-bit version of Excel on Office 365.  

By default, IT departments across the globe install the 32-bit version of Excel on Office 365.  While that works for most, Excel's 32-bit version is not sufficient for running the more complex Excel workbooks used by finance and accounting teams.  See this Microsoft Office article about why multiple Pivot Tables, slicers and VLOOKUPs can constrain your Excel resources.   

Finance and Accounting users are frequently the largest Excel consumers, but your IT support team may not realize it when deploying PCs to users.  If your Finance and Accounting teams aren't using 64-bit Excel today, there may be some support team resistance to making the change and deploying 64-bit.  Historically, Microsoft Office recommended 32-bit installs by default; however, it did not apply to power users like Finance and Accounting teams.  Here's a link to another Microsoft Office article which might help persuade.

Incapability with existing add-ins, such as Hyperion Essbase, is the primary issue which may need to be addressed. 
  • First, I recommend seeing if there is a 64-bit version of your add-in.
  • If not, consider installing anyway and testing the impact.
  • If impacted, explore with your IT team other solutions, such as a 32-bit Excel version with the add-in installed inside a Citrix environment and the 64-bit Excel version on your desktop.
If you are experiencing install setbacks, don't give up; I assure you the 64-bit version is worth it.  While you wait for IT to validate add-ins, try one of the other solutions below. 


Disable Add-Ins

Excel Add-ins sometimes behave badly, especially when the version of Excel the add-in was built on and the current user version of Excel deviate.  This seems to be especially true in the Office 365 environment where updates can occur monthly.

Initially, try disabling all add-ins and turning them on only when needed.  To effectuate, in Excel go to File, Options, Add-ins, Manage, Excel Add-ins, Go.  Uncheck all the add-ins.  Next, repeat these steps, but select Manage, COM Add-ins, Go.

πŸ’₯BEST PRACTICE TIP
Speed up the add-in disabling process by adding a short-cut to your Excel Quick Access Toolbar.  In Excel, go to File, Options, Quick Access Toolbar, Choose commands from: All Commands, Add-ins (the first one, which has no icon & a drop down menu). πŸ’₯

When Excel crashes, keep track of which add-ins, if any, were enabled.  Once an add-in has been identified as a culprit, work with your IT team to address.  In the meantime, whenever you need to enable the suspect add-in, save backup copies often. 

If Excel crashes at the same frequency when the add-ins are disabled, then add-ins is likely not your primary culprit; read further and see if one of the other solutions helps.


Prioritize Excel

All running applications share processor time.  Tell your computer to give Excel more love by changing the priority level.  

Use Ctrl+Alt+Del to open Task Manager.  On the Details tab, right click on Excel.exe process.  Choose Set Priority.  Then, select either High or Above Normal.  

The priority auto-resets to Normal whenever Excel is restarted making this a temporary solution at best.

While it may be tempting to choose Real Time, rumor has it that this will make your other applications jealous, your CPU's head spin, and your PC crash.  πŸ’”


Check your resource monitor

Return to Task Master.  On the bottom of the Performance tab, select "Open Resource Monitor".  This tool provides utilization visuals for the processes running on your machine.  Choose the Overview tab and keep the 4 charts open and visible while you work.  When the Resource Monitor charts are at their maximums for an extended period of time, drill down on the applicable Resource Monitor tab to try and isolate what is dragging you down.  With data in hand, partner with IT support to achieve improved performance.  

In this lesson, you learned how to eliminate Excel crashes by:
  • Installing 64-bit Excel,
  • Disabling add-ins,
  • Prioritizing Excel, and
  • Checking your resource monitor.


Prior post: Measures Inside Measures
Next post: Distinguishing datasets in Power Pivot


πŸ’¬Always love hearing how others have tackled Excel performance issues.  Drop a comment below to share.

Choose your own Data Adventure


New to this blog? Start here.

Choose Your Data

Time to load and transform your own data using Power Query (PQ).





Choose a workbook, report, or query which you regularly modify. Good candidates for this intro level exercise require recurring scrubbing or processing such as:
  • Splitting, combining, or removing rows or columns
  • Extracting data from columns
  • Combining multiple files with identical layouts
  • Changing header names
  • Adding a column that uses simple conditional logic (VLOOKUPs in the same worksheet or IF statements)
  • Adding a column that contains a simply mathematical operation
  • Performing a VLOOKUP from one file to another
The goal is to select a file that allows you to gain confidence using your new Powers by flexing your muscles; the goal is NOT to take steroids and blow your muscles up unnaturally, disfiguring the results.


Get Your Data

In Excel, start a New workbook.

Office 365, Excel 2016, and Excel 2019 users
In the ribbon, go to the Data tab, Get & Transform Data section.

Excel 2010 and Excel 2013 users
In the Power Query tab, go to the Get External Data section.

All users
Explore the importing options available.

Some of the most popular options for finance are:



Choose the data source type corresponding to the source for your data.

Browse to your file and select “Import”.

On the pop-up Navigator screen, your choices will vary depending on the source file type. The example below is the pop-up screen after choosing an Excel workbook as the source.

  •     Selecting the folder icon "Query CC transactions" imports all the subitems.
  •     Selecting Table1 or Working_Budget_Query brings in those Excel Tables.
  •     Selecting All_Trans brings in that worksheet in the Excel workbook.
  •     Selecting any item will provide a preview of the data to be imported.
Once a selection has been made, select "Transform Data" for newer Excel versions, or "Edit" for Excel 2010-2013.


Explore the Power Query Editor 

Below the ribbon, the left side contains the Queries menu. If your import included multiple items, you can locate the other queries by expanding the Queries menu.

The center contains a preview of the columns in your query, but a maximum of 999 rows. Any changes made in PQ are stored in your new workbook and do not affect your original source file.

The right side has Query Settings.

Under Name, rename the query using the following best practice standards.

No spaces. If it's a data query (like GL activity), add Data in the name. If it's a lookup query (like a chart of accounts), add LU in the name. In our prior exercises, the queries were named "Bank_acct_LU" and "GL_bal_Data".

Notice in the above Applied Steps area, PQ has already recorded some steps. These will vary depending on your data source. Selecting the gear next to Source or Navigation will take you back to the Navigation prompt. Selecting the X to the left of any step will remove that step.

πŸ’₯BEST PRACTICE TIP
There is no undo in Power Query.
Be careful when removing steps. If you accidentally delete a step, you can close the query and discard any changes; however, you will loose all changes made during the current session.


Explore the PQ Menus

Let's discuss the 3 tabs where most processing takes place: Home, Transform, and Add Column.
  • Home steps can be applied to the entire query.
  • Transform steps apply to selected columns.
  • Add Column steps result in adding new columns to your query.
Interestingly, the same step may be listed in different tabs, but execute differently. For example, Extract on the Transform tab extracts the requested information from the existing column, leaving it behind, and removing what is left. Whereas, Extract on the Add Column tab keeps the existing column as is and creates a new column with the extracted data.

The Home tab

Try adding some of the Home tab processes as steps to your query. If the step doesn't perform as expected, select the X next the Applied steps to remove it.


Close & Load is the final step of the query process. This loads the query in to the Excel workbook. Outputs are either an Excel Table, a Pivot Table, a Pivot Chart, or Connection only.

Manage Columns and Reduce Rows allows for quick cleanup of your file, removing rows or columns. In addition, you can remove only blank rows, only duplicates, or rows that have errors. An error gets flagged in PQ when the data in a column does not match the data type for that column.

To sort, select a column and the appropriate ascending or descending button. To sort by multiple columns, select the second column to be sorted and repeat. It will be applied as one step with multiple sort criteria.

Split Column is a powerful PQ function. Explore the numerous options available including split By Number of Characters far right or far left, which replaces the LEFT and RIGHT functions in native Excel. Splitting By Delimiter, Custom, can include a full string of text, compared to native Excel's single character split.

Group By aggregates data for a designated column. Similar to building a Pivot Table, but inside a query. Columns not specified in the Group By dialog box are removed from the query.


Data Type specifies the type of data that is in a selected column. Any data in a column that does not meet the data type characteristics will result in an error. For example, data type Decimal Number will result in an error if the value in a row is "text".

Use First Row as Headers and Use Headers as First Row allows the promotion or demotion of the first row or headers.

Replace Values leaves an audit trail to allow others to follow the transformation from the source file to the revised analysis. Something that native Excel's Find & Replace doesn't provide.

Merge Queries, Append Queries, and Combine Files allow the blending of multiple data sets replacing VLOOKUPs or their counterpart INDEX, MATCH. There is a lot left to explore on this subject; when getting started, keep it fairly simple, like our examples in the Intro Series exercise.


The Transform tab

The Transform tab performs actions on selected columns. The menu options available differ based on the data type for the selected column(s). You'll notice some duplication of commands from the Home menu. This allows you to perform all column transformations without flipping between two menus.






Some of the key processes to consider trying on the Transform menu are described below.
Transpose allows you to flip rows and columns, similar to Paste Special, Transpose in native Excel.

Reverse Rows flips all rows so that the bottom row becomes the top row and vice versa.

Replace Values has an expanded option to Replace Errors for cleaner reporting.

Fill Up and Fill Down fill in blank spaces above or below each cell.

Initial data in native Excel

Data after loading to PQ

 Transformed using Fill down

Move includes quick shortcuts to move a column to the beginning or end of your query.

Format is used to tidy up text records using Trim or Clean.  It also provides options to change the case.
Merge Columns combines selected columns, separating them by a designated character or string.

Extract is a powerful data cleansing tool with multiple options for plucking out the data you need from a cell, replacing LEFT, RIGHT, MID, and FIND functions in native Excel.
Standard is a quick way to perform simple mathematical operations on a numerical column. Try "Multiply, "-1" to flip the sign of all numbers in the applicable column.

Rounding includes Round Up, Round Down, and Round.

Date has enough functions available for its own upcoming blog post.  Most options are self explanatory and expand your ability to transform a date column quickly and easily.


The Transform menu should give you plenty of options to start working your own magic in PQ.

πŸ’₯BEST PRACTICE TIP
Learning new tricks is an investment.  Consider building out a few steps in PQ, loading the query and finishing your transformation in native Excel.  This progressive approach blends both worlds until PQ becomes second nature (which it quickly will with a little practice).πŸ’₯

The Add Column tab

The Add Column processes add a column to the query. Some of the functions are the same as under the Transform tab, except Transform performs the action on the selected column and Add Column keeps the selected column and adds an additional column with the action performed: the duplicate ones to explore are Format, Merge Columns, Extract, Standard, Rounding and Date.


Column From Examples was developed for people learning PQ.  Input samples of values for your new column and PQ will try and create the column.

Custom Column can be used to create various types of columns.  Try creating a text column by entering ="Text".  Or, create a mathematical column by inserting two columns that are multiplied together.
Conditional Column creates a column that if a value meets specified criteria then the output should be as defined.  If not, additional rules can be applied or a null value will be the output.




Duplicate Column duplicates.


Hopefully this has been a successful data adventure for you. It's time to wrap up with a Close & Load and start analyzing the results.

In this lesson, you learned how to:
  • Use your own data to start automating using Power Query;
  • Choose different data sources to load to Power Query;
  • Modify the query name;
  • Remove Applied Steps; and,
  • Create automated processes from the Home, Transform, and Add Column menus.


Prior post: The Reward, Month 2
Next post: Remove duplicates


πŸ’¬  Your comments drive my posts.
What can I teach you next in order to move you forward in the revolution?

The Reward, Month 2



New to this blog? Start the Intro to Power Query series here.

The reward for the previous set-up comes as soon as you get a new GL or bank account file.


Choose Month 2 data


The Month 2 GL and bank account files are saved in the SOLUTION Merge file.  Unhide the worksheet, Data, to find the Month 2 data.

Copy and paste the Month 2 data over each of the tables, or if working with your own file, paste the Month 2 data over the original source files saved in the Load Data exercise.


Process

Place your cursor anywhere in the Report Table.  Right click, and refresh.

Update the "As of" date in the report header, and the report is ready for analysis.




Life before Power Query

Treasury adding a new column to the Bank Account Listing would have tested most native Excel solutions.

Solutions using VLOOKUP would need to be modified.

If you compare the Month1 and Month2 reports, it's obvious the only change was the Balance.  However, in native Excel, you would have to either visually compare or perform some functions to ensure there were no additional changes needed.

This is a simple example with only 4 accounts.  Imagine working with a much larger dataset with many more changes each month.

In this lesson, you learned:
  • Life after learning Power Query will never be the same.


SOLUTION




Prior post: Merge: Power Query's VLOOKUP
Next post: Choose your own Data Adventure



πŸ’¬  Feedback? Post a Comment below.

Merge: Power Query's VLOOKUP


New to this blog? Start the Intro to Power Query series here.


Merge is like a Power Query VLOOKUP. 

In Power Query, Merge links two queries together by joining matching columns. In the Intro to Power Query series, Merge will be the final step in building the automated Treasury report.    


MERGE

Start by opening the SOLUTION Process Bank or continue building your own file created from the prior "Process Bank Account Listing" post.



If you are outside of the Power Query Editor, then Merge is an option directly from the Query menu. When your cursor is in one of the tables output by the queries (such as cell A1), you'll find a Query tab at the top of the ribbon.  Select the "Merge" button.


If you are in the Power Query Editor, then select "Merge Queries" from the Home menu.



In the new Merge dialogue box,
  • Select the queries: GL_bal_Data & Bank_acct_LU from the drop down menus;  
  • Hold Ctrl and select the two "GL Account" columns. This makes the first match.  
  • Continue pressing Ctrl and select the two "Dept" columns.  This makes the second match.  Notice the 1 indicating that the GL Account columns should be compared to each other and the 2 indicating that the Dept columns should be matched.  
  • Select "Ok".




A third query has been created called "Merge1".  Let's rename it "Report".
Change the name to Report

Now let's take a look at what's been created.  The first 4 columns are exactly the same as the GL_bal_Data query.  A 5th column was added, which represents the Bank_acct_LU query. 










We can expand the Bank_acct_LU column by selecting the double arrows on the top of that column.  Deselect "Use original column name as prefix".  Then select "Ok".

PQ has now created a merged table that shows each column from both queries, lined up by GL Account and Dept.










Finalize the Query

For illustrative purposes, we brought in all the columns from both queries.  However, GL Account.1 and Dept.1 can be removed since they are redundant.  Hold Ctrl and select the two columns; then, right-click on one of the columns and select "Remove Columns".

Let's rearrange the columns, so they are in the following order:


To move a column, select the column and drag it while holding down the left mouse button.

On the Home tab, select the "Close & Load" dropdown, then "Close & Load To".  In the Import Data menu that pops up, select a Table in a New worksheet.



Finalize the report

We are all done with PQ.
  Time to work in native Excel for the final cleanup.


With your cursor in the new Report Table, go to the Table Tools, Design menu, and select the Table Styles, None, in the top left corner.


  • Make the headers bold.  
  • Make the Balance column, currency with two decimals.  
  • Insert three rows above the Table.
  • Add a title in row 1: "Available Cash at Monthend".
  • Add a title in row 2: "As of October 31, 2018".
  • Two rows below the Table add a footer: "Total Available Cash at Monthend".
  • Add a total balance, formatted bold with a double underline.
  • Hide gridlines.




Congratulations!  You've completed the build out of the new report.
🎈🎈🎈🎈🎈🎈🎈🎈🎈🎈🎈🎈🎈🎈🎈🎈🎈

Next month, this is now a 3-step process.




  • Choose the files (GL data and bank listing)
  • Process (right click in the Report Table and select Refresh)
  • Analyze

In this lesson, you learned how to:
  • Merge two files together to create one query,
  • Expand a column containing a Table,
  • Rearrange columns, and
  • Take a Table as a query output to create automated reports within native Excel. 




Prior post: Automation






Automation

60% of Finance work can be completely or mostly automated according to a recent McKinsey & Company study. About 1/3 of the savings opportunity is from robotic process automation (RPA), such as Power Query. 

Get started with Power Query here.

Process Bank Account Listing


New to this blog? Start the Intro to Power Query series here.

The Accounting Request

Recall we are producing the following report using the Bank account file below.










Access the Query

To transform the data, we now need to convert the Bank account listing from 7 columns in to 3 columns:
  • Bank,
  • Bank Account Number, and 
  • Account Type.

Let's get started where we left off on the "Process GL data" exercise.  Open either your exercise workbook or the SOLUTION Process GL file.

Access
the queries by selecting on the Data tab, Queries & Connections (Show Queries in some Excel versions). Right click on the "Bank_acct_LU" query and select "Edit" to open the Power Query (PQ) Editor.









Remove columns


First, let's modify the query by removing columns
not needed.

In Power Query, there are two approaches for removing columns: selecting the columns to keep and Remove Other Columns or selecting the columns to remove and Remove Columns.

Since the Bank account listing is a manually maintained report produced by Treasury, it's possible that columns could be added or deleted. By choosing "Remove Other Columns", our analysis will be protected from future column additions or deletions.

Hold down the Ctrl key and select the following columns: "Bank", "Bank Account Number" and "Account Type". 

On the Home tab, select the drop down menu on Remove Columns, then select "Remove Other Column".



Change Type


The "Bank Account Number" column is in data type ABC 123, Any. PQ autoassigns the ABC 123 data type when it can't conclusively determine the data type. 

Let's change the type
of "Bank Account Number" column to data type "Text". 

On the column header, click on the "123". Select "ABC Text".
πŸ’₯BEST PRACTICE TIP
Don't leave number and date columns as data type, ABC 123, Any.
When queries are not working as expected, ABC 123 is a primary culprit as PQ functions frequently rely on a specific data type in order to operate correctly.πŸ’₯


Add Conditional Column


Let's start making connections between the GL balance data and the Bank account listing.

Today, the cash accountant keeps a sticky note on her desk notating which GL account number goes with which bank.

Let's add a GL account column by going to the "Add Column" tab and selecting "Conditional Column". Conditional columns are PQ's version of IF statements.


PQ uses plain English fields and drop down menus to create rules. Create the first rule using the parameters below.

Select "Add rule" to add in two additional rules for Chase and Bank of America. Then select "OK".
Change the data type of the new column to type "Text".
Let's do this again, but this time let's assign a dept for each bank account.  Once again, the cash accountant keeps a sticky note to know how to code cash related to each account.

Go to the "Add Column" tab and select "Conditional Column". Create a rule as follows.  Use "Add rule" to create the 2nd-4th rows.




Notice that the account numbers can be copied from the query and pasted into the Conditional Column box. Close the box, copy an account number, and then select the gear button for the Add Conditional Column step, and paste the account number in to the rule.

Also note, department 078 has a single quote ' before the 0. This indicates to PQ that this is text and not a number and will retain the leading zero. 

When finished with the rules, change the data type of the Dept column to "Text".

We now have a look up table that provides the GL account number and dept coding for each bank account. Hard coded knowledge which doesn't disappear if the sticky note gets lost, or the accountant leaves their current role.  


Close & Load.

In this lesson, you learned how to:
  • Future proof using Remove Other Columns,
  • Understand the ABC123, Any data type,
  • Create conditional columns, and,
  • Copy data from queries and paste in to rule prompts.

SOLUTION


Prior post: PowerBI and PowerPivot 
Next post: Automation


πŸ’¬  Can you see the potential to use PQ in your own work? I'd love to hear about examples in your work that might benefit from PQ use. Let me know in the comments.