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
2 answers

Create new variable based on existing columns of a cell in Matlab

I have a cell-array with 600 000 rows and 5 columns. In the following example I only present 3 different codes and a period of 5 years. Input: c1 c2 c3 c4 c5 1 2006 20060425 559 'IA' 1 2007 20070129 559 'LO' 1 …
user3557054
  • 219
  • 2
  • 11
2
votes
3 answers

Sum array of data within date range where date is text

I have an Excel table of the following format: And I would like to answer the following question using Excel formulae: What is the sum for Disney during 17-Nov until 20-Nov? My attempts I tried the following approaches, unsuccessfully: Using…
info_seekeR
  • 1,296
  • 1
  • 15
  • 33
2
votes
0 answers

How to set date columns format in pivot table?

I'm facing a problem with date fields format in Laravel on a Pivot Table. What I want to achive is to use "created_at" and "updated_at" fields in Unix time format INT(11) instead of the TIMESTAMP. I also tried to use a custom Pivot but without any…
cardy
  • 103
  • 1
  • 10
2
votes
2 answers

Table of four columns (x,y,z, value) to matrix table

I would like convert data that is in four columns to a matrix table. I've tried to use OFFSET function and it works but my data is too large (about 100,000 cells) and it crashed. So, I wound like to try to do this by macro, can you suggest how to do…
Krsnik195
  • 79
  • 1
  • 8
2
votes
2 answers

Pivots and Run-time error 1004: Application-defined or object-defined error

I'm quite new to macros and VBA coding and I'm trying to create a really simple macro that takes the data from a table with 33 columns and convert it to a pivot. Only the last 3 columns (31, 32, 33) contains numbers and I need that to appear on the…
Simon
  • 19,658
  • 27
  • 149
  • 217
2
votes
1 answer

SQL Server : PIVOT Timestamp and calculate

I have the following table +--------+-------------+-------------+-------------------------+-----------------+ | Server | DriveLetter | SampleValue | Timestamp | CounterName …
2
votes
2 answers

Transpose CSV data with awk (pivot transformation)

my CSV data looks like…
user3657346
  • 23
  • 1
  • 4
2
votes
1 answer

Unpivot table in SQL Server

I have a table with following columns: SeqNo, Date, Code, Val1, Val2, Val3,.. Val20 I need to get this representation (I assume I should unpivot table part from Val1 to Val20): SeqNo, Date, Code, Val where all Val1 ..Val20 columns go to Val…
Roman
  • 391
  • 2
  • 4
  • 17
2
votes
2 answers

How to Sum value of Pivoted Columns and add it into another Pivoted Column

I want to sum up all the CountHours and display in pivoted column Total.Total is the sum of all SUnday , monday ... for particular UserName. How to achieve this ? select FullName,Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Total from…
user3590485
  • 241
  • 1
  • 9
  • 19
2
votes
2 answers

Grand total for pivot table not giving me the correct amount when using a calculated field

I have a pivot table that I put a calculated field in. the calculation is =IF(fddue_date
Turtleman10
  • 119
  • 1
  • 2
  • 14
2
votes
2 answers

Pivot Table Conditional Sum or Count

I have a data tab with following columns: State => string City => string Person_ID => int Status => values(0/1) OnLeave => values(0/1) Need to create a Pivot table like below: Report Filter: State Row Labels: City Values:…
Vasanth
  • 1,670
  • 1
  • 13
  • 17
2
votes
1 answer

Hide pivot items efficiently

I have built a report based on a pivot table which feeds from a data table. The detail is quite long (tens of thousands of lines) and the user wishes the data to be summarized by a specific field so that he can drilldown only on totals that he is…
ApplePie
  • 8,814
  • 5
  • 39
  • 60
2
votes
1 answer

Top X in Excel/PowerPivot Pivot Table Filtered by Column Label

I'm working on a Powerpivot Pivot Table listing sales for my company. The table looks like this: Row Label: Client Name Column Label: Year Values: Sales Amount So something like this (columns are Client Name, 2014, 2013, 2012) Client 1 | $10,000 |…
2
votes
3 answers

Filter Grand Total in PivotTable based on amount condition

I have a list of customers with amounts in two periods which are compared to each other and create a GRAND TOTAL value so you can see an increase/decrease of customer value in time. I would like to select only those customers who have a Grand Total…
Jaroslav
  • 21
  • 1
  • 1
  • 4
2
votes
1 answer

Expand a column holding iterables into rows

Say I have a DataFrame like the following: df = pd.DataFrame({'baz': ['yes','fine'], 'foo': [['a', 'b', 'c'], ['s', 'r']]}, index=['W1', 'W2']) > df baz foo W1 yes [a, b, c] W2 fine [s, r] How can I expand…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564