Excel 2003 Charting: Chart Data Too Complex - excel

I have written a macro in excel 2007 to log water-level readings. Once logged, it automatically charts the data for each of the 30 wells. However, when the workbook is opened in Excel 2003, the chart does not work complaining that the chart data is too complex to be displayed (works fine in 2007).
There is one series per well (each well data is logged on a separate worksheet) and has the following formula (so that it will automatically update the chart):
=IF(COUNTA('DW1'!$D:$D)-3>0,OFFSET('DW1'!$D$6,1,0,COUNTA('DW1'!$D:$D)-3), 0)
Where DW1 is the worksheet name containing the data for well DW1.
Any ideas about what is going on? I am using the if statement so that the chart doesn't throw errors if there is no data for a well.
I am thinking that the formulas together exceed the limit of the Series data. Anyway to shorten this or change the formula?

In Excel 2003 and older versions, there is an unavoidable limit of 32,000 data points per series in a chart.
In order to display the chart, you need to reduce the number of data points. Either narrow the limits of the X-axis or use a filtering algorithm to remove some of the 'uninteresting' data points. You probably don't want to just decimate the data indiscriminately, as that may remove some of the highs and lows in the data series that are of interest.

Going to run individual charts for each PZ. Pretty sure I am hitting some kind of limit with the data series formulas, not the data points (as there are really not that many).

I do not have an answer to your question, sorry, but a workaround that might be useful.
I worked on a project about 10 years ago where we were exceeding Excel's data-point limit for charts. As much as I wanted to use Excel for the task, I couldn't get it to work.
I resorted to using Gnuplot for the charts. It was a hassle to introduce another technology, but it performed very well on the task.

Josh -
What's the series formula? What you've posted is a worksheet formula.
The 32k limit on points per series is the same in 2007 as in 97-2003.

Related

Excel Line Chart with separate data points for a single line

I have a weird problem that google's not being too kind on results (mostly basic things on how to create a line chart, or combination charts, neither of which I'm after).
I'm trying to automate a report we do each month, I've managed pretty well so far by having a linked excel chart and objects, I have a single sheet in excel I paste my formatted data (set format is consistent each month) then excel picks out the data, creates the charts and when opening powerpoint it reads it all in from there.
Great! Until I was given a new piece of information, there's monthly data and a yearly tally in my data, monthly data is shown with a particular "weighting" applied, year with a different one and it's this that's caused a problem.
The package that's exporting the data can't show these figures contiguously, so we have an export with all the monthly weights, then with annual weights.
So say originally we were looking at C83 to O83 for our data for this year, we're now looking at C83 to N83 and O1364.
I've tried to look at how I would add this to the chart, which currently has the reference:
='Monthly Data to Update'!$C$83:$O$83
But doing anything + or & doesn't seem to work.
So, I decided to just pull all my data in to contiguous set to reference, (so ='Monthly Data to Update'!C83 one cell, ='Monthly Data to Update'!C84 next cell and so on).
This caused a problem for future months that're empty, having 0's in them, so I updated my code to check:
=IF('Monthly Data to Update'!C83=0,NA(),'Monthly Data to Update'!C83)
And this works, my table below my chart is blank for the empty months, my chart doesn't try and plot these empty months. Hurrah!
Now, the wrinkle. The Yearly nets aren't charted but are displayed in the table (I'm not up on Excel charts so how this was originally setup, I just copied the charts from Powerpoint in to Excel and reset the data to where it needed to be before copying it back to Powerpoint as a data linked chart).
First chart I did, works fine, second chart I did it's decided to start plotting the annual net for two of the three lines = \
So, this is how my chart looks like, running off the contiguous (but wrong) data:
And this is how it looks running off the fetched contiguous (correct) data:
It's really baffling, Exceeded and Met now plot the Year to Date figure, whereas Not Met behaves as it should, and they all have the same data layout (on the right) using the same formulas (just pointing at different cells).
I am confused..
I'm hoping to keep this light and simple so have avoided using any macro's to date, so that down the line when I hand this project over to someone any maintenance should be easy to do (say add a chart) without them asking me and me then having to remember what the hell I did a few months ago.. - so if this is doable without going down that line (which, seems like it should be, given my first chart the two lines there worked fine, and one of the three in this is behaving itself).
Apologies for the long winded description, I've given full history so if there's a step further back I could've done better, then happy to fix it up there rather than where I got to.
Ah, so apparently I could've had non-contiguous data with a comma, not a plus or ampersand, so the chart data would be:
=('Monthly Data to Update'!$C$83:$N$83,'Monthly Data to Update'!$O$1404)
So I don't need to rebuild the data in to a contiguous set, and my charts don't cock up when selecting the data this way, win's all around.
Thank you for your time, hopefully this helps someone in the future. (as a saving grace for my lost morning)

Calculated Field

I am trying to create a simple pivot table which will tell me how many community residents reported a particular problem, and what percentage of them reported each problem type. I have a data set with name, and then columns for each type of problem. Here's an small sample of the data set:
I have created a pivot table which sums each of these columns and also provides me the total number of people who reported any type of problem at all. Here's what I have:
I want to add a second column to this pivot table that gives the percent of times each problem type was reported. Sounds simple, but because of the structure of the original data set, I can't figure out how to do it. I can set up formulas outside of the Pivot Table which reference the table, but in doing so I forfeit the ability to graph the percentages on a pivot chart. Any ideas how to create a calculated field for this pivot table?
Just to be clear, what I want is something like this, except all contained in the structure of the pivot table:
Edit: I've changed the example of the data set. Here's an explanation of the pivot table. The values under the "# Reporting Issue" column are counts of all the 1's under each corresponding column in the data set. This meant that I had to add each row to the pivot table independently, as you can see here:
I'm open to the idea that I need to change the formatting of the data set, but I'm not sure of the best way to do it. This was set up initially because it allowed for easy compilation into a data table, but Pivot Tables seem to be a different story.
Hopefully this edit clarifies things.
You need to unpivot your data so that you turn it into a Flat File...something that the PivotTable can consume properly.
The easiest way is to use something called PowerQuery, which is baked in to Excel 2016 but available as a free addin from Microsoft for any other versions. Google PowerQuery Unpivot and you will turn up hundreds of tutorials, such as this one from my good pal Chandoo . PowerQuery looks slightly daunting at first to a first time user, but it is freakin easy once you get your head around how to use it. PQ is by far the best addition to Excel in years. PowerPivot being a close second.
If you can't install PowerQuery, then you can use your current data structure to make a 'staging pivot', and then drag the Values label that will appear in the Columns area to the bottom of the ROWS pane, like in this excerpt from a book I'm writing:
Note that my Year categories are equivalent to your Issues categories.
That will emulate the flat file layout you’re after. All you need to do then is turn this intermediate PivotTable back into a normal range, change that Values heading to Issue, and add a Count heading and you’ve got the flat file you need to build a useable PivotTable.
You can also use VBA. Google Unpivot VBA and turn up hundreds of results, including this blazingly fast code I posted some time back. (Look for the code under the —Update 26 November 2013— heading.)
You can also use the DoubleClick extraction trick.

Programmatically add rows to an Excel data model via C#

We're looking at allowing our customers to download an Excel file from our web application which contains a raw export of their data along with some basic charts and pivot tables based on that data.
The basic way, we want to make this work is that we have a fixed Excel file which contains all the reporting elements in one worksheet and have room for the underlying data in another worksheet. When the user requests their Excel report, we programmatically fill out the data worksheet with their results and send them the final Excel file.
Everything seemed a bit to easy when doing the prototyping with a fixed set of data. The dataset we worked with was added to the Excel Data Model and we then set up the charts and other reporting elements. However, when using that file as the template for the generated Excel file in our application we are finding that the definition of the data model still remains - meaning, that we built the "protype" with a table definition of $A$1:$T$5879
but when generating the report, that definition isn't changed to contain whatever size the added dataset might have.
We're using EPPlus to work with the generation of our Excel sheets and have so far been unable to find any sort of solution to this kind of problem. This might very much be due to us being quite Excel novices. The goal is to have the user experience, that the charts and pivot tables contained in the Excel sheet reflects the total dataset contained in the Excel file without them having to do anything.
Ok, I've actually found a solution for it.
The solution was right infront of us.
We define the dataset as a named set - this is done under under the "Formulas" and inside the "Name Manager". We have a range which defines our dataset - the "Refers To" field when defining a range can take a formula. So intead of giving it a fixed size, we use this: =OFFSET(Data!$A$1;0;0;COUNTA(Data!$A:$A);COUNTA(Data!$1:$1))
This counts the amount of rows and columns, with reference to A1 in our Data worksheet. All our pivots are set to reload on startup and that seems to work.

load VBA data to line chart

I need to feed data into a line chart with VBA. I need to give a basic unidimensional range when I do it with Excel in a raw test. The thing is that now I need to hide some things in VBA code, so that the user just sees a curve resulting of some basic input at the click of a button.
I think there are at least two options for me :
either have the chart object placed in the Excel before, and having it point to some VBA snippet. In this case, should I somehow point to VBA from Excel ? Or would VBA access the chart area by some ID ?
create everything dynamically from VBA, the chart window, the chart, and the series input. This might be trickier to figure out maybe as I have frozen panes, so there would be the question of which pane is active (I'd like to avoid to have to do Selects to select the right one)
What would you recommend ? And in either case, how to actually do it ? What type of data to put in ?
Thank you so much !
I was involved in a project a couple of years ago that might be relevant.
A report was created monthly for the organisation's management board which contained dozens of charts. It was a near full time job for a statistician to collate and process data from across the organisation that provided the source data for these charts. I was asked to automate what could be automated.
It became clear that the appearance of the chart could not be automated. The statistician and the management board's staff held regular discussions and often agreed minor changes which they thought would better present the organisation's performance.
I could automate the collection of the data, its processing and placing of the results in the ranges from which the charts got their data. The most I ever did with a chart was change the size of a source range.
What would be the parameters that would control your macro's changes to a chart? How would your macro get the determine: type of chart, nature of the axes, text, etc?
Hope these thoughts help. I could look out my notes if my experience seems particularly relevant.

Creating Excel dashboards from info stored on SQL

I'm creating an Excel dashboard that imports a variable number months' worth of financial/accounting information from a database to an Excel sheet. Using this information I have a Calculations sheet that computes some financial indicators, again, month by month. Finally, this information is displayed in graphs on a separate sheet (one indicator per graph, with the monthly information plotted to see the tendencies). Currently I have written VBA code that formats the sheets to accomodate the number of months requested, pull the data from the SQL server, and update the graphs. Since there are 53 indicators for each operation (6 operations), this process takes about 3 minutes.
Does anyone recommend a better way to do this? The current way 'works' but I've often thought that there must be a more efficient way to do this.
Thanks!
Chris
You could look at skipping out the excel part and using SQL server reporting services (SSRS). If you have ever used business objects or crystal reports its kind of the same thing and I would imagine would offer better performance than doing things in excel.

Resources