+ Reply to Thread
Results 1 to 5 of 5

Combo pivot table graph?

  1. #1
    Registered User
    Join Date
    09-10-2018
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    5

    Combo pivot table graph?

    I have a script which collects performance metrics every 10 seconds and aggregates the data per hour into a CSV file. This is then imported into Excel, and I’m building some daily graphs for visualising the data.
    The logged data is broken down into three categories, Slow, Medium and Fast, and shows the number of times each were triggered per hour, as well as the average, minimum and maximum raw speed values for each category, e.g:

    Date/Time Category Count Avg Min Max
    2018-09-10T00:00:00 Slow 216 15 5 22
    2018-09-10T00:00:00 Medium 144 45 34 64
    2018-09-10T01:00:00 Medium 162 50 36 60
    2018-09-10T01:00:00 Fast 198 80 75 99
    (Each hour can have a different number of rows associated with it)

    Currently I have added a new column which parses the ISO-8601 timestamp as a native date/time, use a pivot table aggregating the counts of the three categories per hour, and display the results as a stacked area graph which is working nicely.
    What I’m looking for is a way of being able to overlay a line graph of the combined average speed per hour, using a Combo graph and the secondary axis. Bonus points for visualising the minimum and maximum datapoints using something like a Stock graph.

    Is this possible, or is there a better way of accomplishing what I'm after?
    Thanks,


    Mike

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Combo pivot table graph?

    How are you importing the data from CSV into Excel? Is the data coming in as an Excel Table? I highly recommend that you get the data into an Excel Table. Excel Tables know how big they are so any formulas, pivot tables and charts built from them reference the exact amount of data they need.

    Explain a bit more about how you get the CSV file and how you import it and attach a sample. This will help use help you better.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    09-10-2018
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Combo pivot table graph?

    Hi dflak,

    The CSV file is generated daily, and currently a new Excel spreadsheet is built each day from the newly imported data.
    Once the process is better established this part will become automated, and at that point Tables sound like a good option.

    Attached is a sample 2-day dataset, with the the pivot table and speed category graph on the second sheet.

    I suspect there needs to be an intermediary data table which collates the data into a more regular structure, but unsure how to best accomplish it.

    Thanks,


    Mike
    Attached Files Attached Files

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Combo pivot table graph?

    I did a couple of things here.

    1. I converted the data range to an Excel Table. Two advantages of Excel tables are: they know how big they are so the pivot table references exactly the correct amount of date and Tables "remember" formulas and copy them down automatically (I don't have to program this).

    2. I set the sheet up to "import" the CSV file.

    Enter the path name to the directory that contains the CSV file in cell B1. Enter the name of the CSV file in cell B3. If the file name is the same every day except for a date stamp, then you could use a formula to generate it.

    Click the Read CSV File Button and the data is imported into the table and since the pivot table reads the excel table, you are good to go.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-10-2018
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Combo pivot table graph?

    Thanks for the suggestions, using tables for the source data especially in conjunction with pivot tables looks to have some nice benefits.
    I hadn't considered putting the data update within the report itself, interesting solution.

    One question though, what was the "Whole Date" field for? Was is just to give the slicer some data to work with? Is it beneficial to use a new column rather than the Days grouping of the original date field?

    I've been making a little more progress on the speed graph (attached) by adding an additional column to the source data which computes the cumulative speed per category per hour, then used a computed field in a second pivot table which sums these and takes the overall average per hour. I'm sure there's probably a way of performing this computation entirely in the pivot table without adding the additional field, but my totals were coming out way off using that approach.

    This is near what I was originally after, although in two separate graphs which is a little cumbersome but workable.

    Also, probably a simple question, but is there a way of retrieving the Slicer's currently selected value(s) in a formula, specifically to show the currently selected day of the week? For example it would be nice to dynamically set a chart title based on the currently selected day. I've seen some examples online using Cube*() functions to do so, but the docs for these don't seem to make much sense for a newbie.

    Thanks,


    Mike
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 02-19-2018, 06:34 AM
  2. Replies: 4
    Last Post: 12-31-2016, 04:06 AM
  3. Replies: 1
    Last Post: 07-29-2016, 04:30 PM
  4. Pivot Table + Combo Box
    By danielt89 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-30-2014, 07:08 AM
  5. Combo Pivot Table
    By no.18shirt in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 07-03-2013, 05:19 AM
  6. Replies: 2
    Last Post: 08-29-2011, 12:29 PM
  7. VBA: Group Pivot Table and Combo Box
    By THE_RAMONES in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-05-2006, 12:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1