How to convert nested group in Excel from SAP report painter export into tabular form? - excel

SAP report painter exports a n-dimensional table in excel as a nested group format (columns A:B). I need to get this onto tabular form (columns D:I) as a summarized table. Ideally I would get a direct data feed onto a summarized table, but that solution is quite far ahead.
Attached photo is a modified snippet for illustration purposes.
I have written a loop in VBA which does it using a variant approach. For approximately 15.000 rows, this takes around 40 seconds for 7 dimensions. I am wondering if any built-in excel functions could do that more efficiently?

Related

Form for displaying and printing from Excel sheet

Is there a simple way to design a form for displaying (and printing on A4) data from an Excel sheet?
Lets say there are 200 rows in the Excel with 4 columns. I would like to make each row more readable by rearranging it like this on A4 paper (see attached diagram), instead of just printing in tabular form straight from Excel.
Can that be done without programming, but only field mapping from a form to Excel sheet?
Data entry not required. View and print only.
A4 printed output should look like this
I think you are out of luck with Excel unless you can write a VBA macro to rearrange the table data.
One option is to use a Reporting tool e.g. you can link/import the Excel data into Access and build a Report, which will allow you freedom to show each record as you like.
You could do a mail merge into Word, as if you're printing labels on a form. It's the same idea, just different data.
There are many examples online, no coding necessary.
Here's one from Microsoft, with plenty of links within in:
How to use the Mail Merge feature in Word to create and to print form letters that use the data from an Excel worksheet

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.

Querying single data points from the Excel Data Model / Power Query (Get & Transform Data)

I'm using an up-to-date version of Excel 2016 (via O365 E3 license) and using Power Query / Get & Transform Data. I can successfully create queries and load them to the page. I have also successfully created Power Pivot reports.
I would like to query single data points from the data loaded via Power Query. For instance, imagine a dataset called DivisionalRevenue with:
Date Division Revenue
2016-01-01 Alpha 1000
2016-01-02 Alpha 1500
2016-01-01 Beta 2000
2016-01-02 Beta 400
I could easily load that to an Excel workbook or include it in the data model and create a power pivot. However, Power Pivot doesn't always meet my requirements, particularly around how the data is displayed on the page. In order to achieve my goal I may want to be able to query individual data points.
I would like to have a cell on the page with a formula in it that I can use to query individual data points. If it was in a pivot table I could use something like:
=GETPIVOTDATA("Revenue",$A$3,"Date",DATE(2016,1,1),"Division","Alpha")
The lookup values (date and division) could be retrieved from a cell on the page or hard-coded into the formula. This is a requirement for several reports I'm working on.
Or, I could add a combined lookup column with Date and Division concatenated and use a vlookup to pull the values like:
=VLOOKUP("42371Alpha",I9:L13,4,FALSE)
Finally, I could use a combination of INDEX and MATCH to identify the correct row number and then pull the data.
All of these solutions require the data to be loaded onto a sheet. One requires a pivot table that has to be refreshed to work properly. The other two require creating arbitrary lookup columns so that you can match a row based on more than one field (date and division in this example), and you have to ensure that that lookup field's formula is properly extended down the length of the data table. In both cases I would have concerns when sharing this workbook with my colleagues in case someone affects the rather fragile setup of the pivot table or the lookup.
So, what I truly want to find is something equivalent to pivot table querying against a dataset.
** This doesn't exist, but I would like to know if something like it does **
=GETQUERYDATA("Revenue","DivisionalRevenue","Date",DATE(2016,1,1),"Division","Alpha")
Does such a thing exist? Can such a thing be done? Can I retrieve arbitrary data points from the dataset created through Power Query / Get & Transform Data?
I think that what you want are cubefunctions:
Some Background
How to easy create cubefunctions from a pivot table
There is a feature in Excel that allows you to query off of a PowerPivot model, but it's not highly advertised for some reason.
Once you have the data in your PowerPivot model, go to your Excel -> Data tab -> Existing Connections -> Tables tab
From there, choose the table that you want to start with. Once that table's data is on your excel sheet, you can actually right click that table -> go to "Table" -> "Edit DAX"
From there you can enter the following DAX function, as an example
EVALUATE
FILTER(SampleData,[Date]=DATE(2016,1,1) && SampleData[Division]="Alpha")
Make sure to choose Command Type=DAX in the drop-down. Here's how it looks on my screen:
To further improve your querying power, you can install the optional "DAX Studio" plugin for Excel, which allows you to write custom DAX queries and then export the results directly back to an Excel sheet.

Merge and sort data from multiple tabs to a single "Master" tab in Excel

Our company was using Google Sheets for the last several months and we had a system working great, but are now transitioning to Excel.
The tab in the Google Sheet where all the data is merged and sorted is called MASTER TEST and is found here
In Google Sheet we used formula:
=query({Data1, Data2, Data3},"Select Col1, ... where Col1 is not null order by Col1")
Data is merged: {Data1, Data2, Data3} is data from multiple tabs.
The result is merged and sorted data. How can I make the same report in Excel?
Basically, every call we receive is logged in a spreadsheet in a tab unique to each representative. We have a CURRENT WEEK tab which is supposed to hold a static version of all the calls received by every rep, sorted by date. In Sheets this was done with a =query() formula, but Excel does not seem to support such a thing.
I tried using Data>From Other Sources>From Microsoft Query but frankly this does not work since it only grabs the data from columns with data validation and gets very slow and breaks with too much data.
Pivot Tables in Excel VS query in Google Sheet
I suggest you using Pivot Tables, or Pivot Query in Excel. Here's some explanations:
Pivot Tables in Excel can handle big data very fast, query in Google Sheets can't do this
but query is more flexible and it refreshes simultaneously.
So if you are willing to work with data in excel, it may be harder to set your report. Sorting is easy task for Pivot Tables, but merging data from multiple tabs is not so easy.
Merging data
The goal in your case is to merge data from multiple tabs in excel. You can make it in two ways:
Use VBA to collect data into single tab.
Use Pivot Tables. Here's tutorial on how to accomplish this.
And still the best way for data manipulating is to use single tab for all your data.

how to setup a excel chart with data points

I have a excel spreadsheet that has been exported from a kendo-ui grid. I have zero experience with excel and I need help turning this data into a excel chart. the attached spreadsheet is what i am working with. Every subdivision name is its own series with (sqft,price) points. is there a way to make one chart with the supplied data?
attached is link to the excel spreadsheet
excel spreadsheet
update from first answer
First you need a table with just one header-row (create a new column for the Arbor .. Values).
The value of this column is the name for the diagram line (instead of serie1 etc.)

Resources