Questions tagged [pivot-table]

A "pivot table" is a method of summarizing data in tabular form. Typically, these have a category column in the left hand side, and multiple summary columns to the right. Each different category will have its own row. Be sure to include the relevant language tag (python, excel, R, postgreSQL etc.) on your question.

A "pivot table" is a method of summarizing data in tabular form. Typically, these have a category column in the left hand side, and multiple summary columns to the right. Each different category will have its own row.

Pivot tables are typically found in data visualization programs, including spreadsheets and business intelligence. Note that a "pivot table" is also known as a "cross tab" or "cross tabulation".

Resources:

8105 questions
2
votes
0 answers

Laravel 5.1.* Custom Pivot Class Array Not Casted

I have a Model called User and another Model called Roles and they are linked with each other through a belongsToMany relationship. But I needed to cast certain pivot attributes so I used a custom pivot class RoleUserPivot which basically looks like…
amith.gotamey
  • 968
  • 8
  • 14
2
votes
2 answers

Flatten a Pandas DataFrame

I have a Pandas DataFrame that looks like this (currently without an index other than the in-built row index, but if it's easier to add indexes to "Person" and "Car", that's fine too): before = pd.DataFrame({ 'Email':…
Dustin
  • 153
  • 1
  • 7
2
votes
0 answers

Excel2011 VBA Trimming String with invisible characters for PivotTable

I'm a new member of your community, my names is Thomas. I used to be a VisualFoxPro Developper years ago, but for now I'm trying to learn how to handle Excel (2011 on a Mac) and VBA. Only on my sparetime ;-). I have googled a lot since I started and…
LeKibbitz
  • 21
  • 5
2
votes
1 answer

Many to many Laravel 5.1, not working, parameter mismatch (string, array)

I was following this tutorials https://laracasts.com/series/laravel-5-fundamentals/episodes/21 but can't make my many to many migrations to work. Without further ado here's the code: Migrations: create Locations Schema::create('locations',…
dbr
  • 1,037
  • 14
  • 34
2
votes
1 answer

Why do I have to refresh Pivot Table to include all fields?

Here is the scenario: Sheet1 has 15 columns and 16,000 rows PivotTable created in Sheet2 for all data in Sheet1 2 new columns of data added in the middle of existing columns in Sheet1. New total is 17 columns Second PivotTable created in Sheet3…
Trevor D
  • 743
  • 4
  • 14
  • 34
2
votes
2 answers

Insert excel data before the pivot table

I keep getting this error: Run-time error '5': Invalid procedure call or argument: I am just learning VBA...& yes, I have searched for the answer on here before I tried to ask this question. First I tried to add single quotes to the…
Whitney King
  • 45
  • 1
  • 8
2
votes
1 answer

How/where does pd.pivot_table store or reference the names of its index and column variables?

I can't figure out how pandas pd.pivot_table stores or references the names of the variables in the table's row/index and columns; from looking at the source code it doesn't seem to store them anywhere in any of its attributes, although str(tbl)…
smci
  • 32,567
  • 20
  • 113
  • 146
2
votes
1 answer

Creating a Cross Tab Query in SQL Alchemy

I was doing some reading on google and the sqlalchmey documentation but could not find any kind of built in functionlity that could take a standard sequel formated table and transform it into a cross tab query like Microsoft Access. I have in the…
bud
  • 485
  • 6
  • 22
2
votes
2 answers

Excel Pivot Table "Group Field" disabled

The setup is Excel 2013 PivotTables, getting data from a SSAS2014 cube. The requirement is to allow users to aggregate measures over the Date dimension, using a strange kind of week in which Friday is the first day of the week. Our time dimension…
SebTHU
  • 1,385
  • 2
  • 11
  • 22
2
votes
1 answer

Dynamic charts from pivot

I have a data set that I am using as an input to a pivot table. I have transformed that data set into a table, so that every-time I add something to the data set, the pivot gets updated automatically. I have also added a line of code, so that…
Broly
  • 799
  • 3
  • 16
2
votes
0 answers

MySQL select dynamic column names from another table

I have three MySQL tables. I'd like to select the rows from one table and use them as the column names in my select statement. Below are my three tables. locations id location_name 1 London 2 Barnes bookings id location_id …
V4n1ll4
  • 5,973
  • 14
  • 53
  • 92
2
votes
1 answer

Applying aggregate function on columns of Pandas pivot table

I generated the following pivot table via taking maximum of values in Z column: val X x1 x2 Y y1 y2 y1 y2 ID a 9 1 5 11 b 8 10 7 6 After taking max on Z values, I need to report mean(y1,y2). The desired table is: …
Kadir
  • 1,345
  • 3
  • 15
  • 25
2
votes
1 answer

SQL Pivot Tables - Copy Excel Functionality

Let's say I have a table like this: Task Type Variable Hours Duration One A X 10 5 One A Y 40 15 One B X 100 29 Two A X 5 2 Two B X …
Matthew Jones
  • 25,644
  • 17
  • 102
  • 155
2
votes
1 answer

c# Collapse Fields in Excel PivotTable

I have a pre-made Excel with PivotTable that gets Data from another worksheet, I fill via c# code. In the PivotTable there are three Row fields, which after getting populated and the Pivot refreshed via code, make all the rows expanded after opening…
chimino
  • 29
  • 1
  • 4
2
votes
1 answer

Laravel 5.1 - pivot table between 3 tables

I'm relatively new to Laravel and have been working on it in my internship for the last 3 weeks however now I have a problem. I have 3 tables: Users, Bids, and Jobs. I want a user to be able to place a bid on the job. The basic structure of my…
caseylouisee
  • 103
  • 1
  • 12