Solved

PivotTable Issues

Posted on 2016-07-22
19
44 Views
Last Modified: 2016-07-25
As you can see from the attached I have a PivotTable which currently has 4 month columns and I have had to add these individually.

What I want to know is, is there a way to add all months at once, set their formatting once, and have grand totals for each row at the right end of that pivottable because right now that is proving impossible.

I would like to be able to sort and filter by dates (being the months) also and then the table update automatically.

Basically I just dont understand whats going on as I have used dates with PivotTables a million times and never have I had to add the months individually like this and then have no ability to sort, group and filter those dates (ie. sometimes I group into quarters) as well as have no ability to total the values within the date periods.

Please help!
Pivotable.xlsx
0
Comment
Question by:recycleaus
  • 8
  • 7
  • 4
19 Comments
 
LVL 31

Expert Comment

by:Rob Henson
ID: 41724437
Couple of issues that I have spotted:

Dates - they aren't true dates, they are text.
Layout of data - because the data is in separate columns for each month, the pivot recognises this as another field so if you want another month added you have to add another field.

Possible Resolution
Change dates to proper dates and change layout of the data to have only 5 columns:
  Site
  Product #
  Product
  Date
  Value

You could then have an additional column that determines whether the row is to be included in the pivot, presumably its the last four months that you display; simple IF statement to determine whether date is less than 4 months ago.
0
 

Author Comment

by:recycleaus
ID: 41724447
Rob I am sorry but I am not following your solution... could you show me what you mean and I can try to implement your recommendation into my full spreadsheet
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 41724450
See attached.
Pivotable.xlsx
0
 

Author Comment

by:recycleaus
ID: 41724453
Rob there is no date limitation, on the full spreadsheet (what I've included in the question in just a subset of the data) it actually goes out to 24 months and my intention is to group it by quarters.

My question is how did you automatically change the source data from the layout in 'Sheet 1' to the 'newdata' sheet. I assume you did not manually copy and paste?
0
 
LVL 31

Assisted Solution

by:Rob Henson
Rob Henson earned 100 total points
ID: 41724468
Look at this version attached instead. I overwrote the conversion calculations and then realised that you might ask that question so have reinstated them.

Additional column at left hand end of original data concatenating Site and Product number.

I did have to Copy and paste the Site and Product details the required number of times though.

If your source data comes from another system in the format you have, the update each month would be copying and pasting another block at the bottom of the new data table. The formulas to pull the values would need adjusting to allow for extra columns.

I have also now grouped the data in the pivot by Year and Quarters.

Thanks
Rob H
Pivotable.xlsx
0
 
LVL 7

Expert Comment

by:tomfarrar
ID: 41725026
You can use the Power Query add on (Excel 2010 or 2013) to change the source data from how it is received to how Rob transposed it.  It works very well, and has the ability to save the steps so they are repeatable the next time the source data is updated.

Let me know if you think this is of interest to you.  - Tom

Also you can group by quarter within the pivot table functionality...
0
 

Author Comment

by:recycleaus
ID: 41725427
OK, I'm way out of my league here and so I apologise for the lack of understanding on my part.

I think its easier if I just attach the 'real' workbook. I have hidden the other pages but basically you can see the table that exists there.

Hopefully Rob or Tom you can quickly set things up correctly for me. What I am trying to achieve is to use that data and create exactly the pivot table that Rob has put together and then each month I simply add data to the background table and the pivottable updates accordingly.
1606---EOM---EcoCycle.xlsx
0
 
LVL 7

Expert Comment

by:tomfarrar
ID: 41725762
The first question is do you have Excel 2010 or 2013?  If so do you know how to activate the Power Query add-in?  If not, you can use a macro (which was given to me years ago by one of the Experts here) to change your data to well-formed data for a pivot table.  I will find that macro if you need it.

In short, the dates you show in multiple columns should be shown in one column and not many.  This is a step in normalizing data that is not well-formed.  Once the data is in one column, then the pivot table gives you the reporting you want.

Another suggestion would be to ask for the data in a better format if that is possible.  It may be the provider thinks you prefer the data in a two-dimensional view.  This would be a great solution if you are having to transform the data every time you get it.  Just a thought....
0
 
LVL 7

Expert Comment

by:tomfarrar
ID: 41725769
Attached is what you data looks like (Unpivoted Data Tab) using the Power Query Add-In.  I was able to create it with basically four mouse clicks.  From this data, the pivot table is pretty easy.
1606---EOM---EcoCycle-Unpivoted.xlsx
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:recycleaus
ID: 41726070
Tom, I have excel 2016 and google tells me Power Query is built in as a result? And agreed, once the data is in that form its childs play.

Unfortunately that is how the data is available. There is essentially no other option without paying for an expensive custom report to be generated from our accounting system.

Are you able to to outline the 4 steps involved that you mention above. Usually I am quite a competent Excel user (albeit this issue has put that to question! haha) so I should be able to follow straight forward steps and do this monthly.

Thanks
0
 
LVL 7

Expert Comment

by:tomfarrar
ID: 41726582
Do you see the Power Query Tab at the top of your Excel along with the other Tabs?  If not, go to File>Options>AddIns.  At the bottom change Manage to COM Add Ins.  Then check

Power Query
Power Pivot
Power Map

Don't need all now, but you will eventually want to use.  

Restart Excel and you should see the Power Query tab at the top of the page along with the other tabs.  When you have this let me know and I will give you the remaining steps.
0
 

Author Comment

by:recycleaus
ID: 41726744
Tom... all 3 are in per the attached
Screenshot-2016-07-25-06.40.12.png
0
 
LVL 7

Accepted Solution

by:
tomfarrar earned 400 total points
ID: 41726790
See attached instructions after you have activated Power Query and can see the tab at the top of your spreadsheet.
Pivot-Issues.docx
0
 

Author Comment

by:recycleaus
ID: 41726794
Wow, that truly is insanely easy! A part of me is upset it was that easy and I had no idea! haha
0
 

Author Closing Comment

by:recycleaus
ID: 41726795
Thanks so much to you both
0
 
LVL 7

Expert Comment

by:tomfarrar
ID: 41726797
If you go out to YouTube and watch some videos about Power Query and/or Power Pivot you can begin to get really familiar with the tools.  They really have taken Excel to a different level.  I have not yet found the time to further develop my skills here either.
1
 
LVL 7

Expert Comment

by:tomfarrar
ID: 41726799
Thanks, recycleaus.
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 41727167
Tom, thanks for finishing off and with a better solution as well. I have yet to investigate Power Pivot; I still use 2010 at work but do have 2016 at home but don't use it for much.

Regards
Rob
0
 
LVL 7

Expert Comment

by:tomfarrar
ID: 41727730
Thanks, Rob, Power Pivot is worth investigating as is Power Query and Power Map.  Though I have not had the opportunity to use them extensively, I have used enough to know they are very powerful.

In short from what I know:

Power Pivot enables you to work with tables that are linked together, and can handle many millions of rows of data.  Not limited to Excel's 1,000,000 rows.

Power Query lets you cleanse data, and I think you can save the query that does it for doing it over and over.

Power Map enables you to visually plot data on maps.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now