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

Creating a pivot table

Suppose I have a dataset that looks like the following, in which years are listed down rows: id<-c(1,1,1,2,2,2,3,3,3) year<-c(1990, 1991, 1992, 1992, 1993, 1994, 1993, 1994, 1995) N<-c(7,8,9,7,1,2,5,4,3) dataset<-data.frame(cbind(id, year, N)) I'd…
Luke
  • 4,769
  • 5
  • 28
  • 36
2
votes
0 answers

Duplicate values in pivot table filter list

I have a rather large filter table derived from a table containing thousands of entries. This uses calculated values for fault diagnosis and for assessing the system availability. I am trying to filter the pivot table values to display only the most…
SadSack963
  • 2,039
  • 2
  • 15
  • 10
2
votes
1 answer

Excel PivotField Orientation is wrong?

I'm using Excel 2010 and writing a VBA function to automatically format various metrics in a pivot table as it is changed by the user (so that formatting is preserved when they add/remove fields). I'm looping through the PivotFields collection to…
Gothic
  • 322
  • 3
  • 12
2
votes
1 answer

Excel: max() of count() with column grouping in a pivot table

I have a pivot table fed from a MySQL view. Each returned row is basically an instantiation of "a person, with a role, at a venue, on a date". The each cell then shows count of person (lets call it person_id). When you pivot this in excel, you get a…
elb98rm
  • 670
  • 6
  • 21
2
votes
1 answer

How to write select query in "in" clause of pivot table?

Hi I am new to Sql Programming. I have a table "Temp" having two fields "Name" & "Software" I am pivoting a table that displays the name and number of versions of software to him. My query for pivot is : select * from temp pivot(count(Software)…
Mohemmad K
  • 809
  • 7
  • 33
  • 74
2
votes
4 answers

ASP.NET - Ideal Control to Display a Pivot Table

I am trying to display a tabular set of data in a databound control, but I need to pivot the table such that the individual records are table columns rather than table rows. The end result is a table with a fixed number of columns and a variable…
Nathan Taylor
  • 24,423
  • 19
  • 99
  • 156
2
votes
2 answers

Issue with vba creating a pivot table, is this an excel version issue?

Quick one, got the following code which goes and creates a pivot table based on a data collection "Data". I run this on the PC that it was created on which runs Excel 2013 without an issue however when I run it on Excel 2007 or Excel 2010 it throws…
William Fuller
  • 21
  • 1
  • 1
  • 2
2
votes
2 answers

Excel , how to find highest column value for a given value from another column

country Initiative 1 Initiative 2 Initiative n Week Country 1 Status 1 Status 1 Status 1 1 Country 2 Status 2 Status 2 Status 2 1 Country 1 Status 3 Status 2 …
user2111700
  • 23
  • 1
  • 1
  • 3
2
votes
1 answer

PivotTable with a known number of columns

I have a table that looks like this OutputTablesID Label ColumnOrder 236 text 1 236 text 2 236 text 3 . . . . . . .…
Roland P
  • 393
  • 1
  • 9
  • 27
2
votes
3 answers

How to find count of transaction of type1 and type2 for each customer in mysql

I have a customer table: id name 1 customer1 2 customer2 3 customer3 and a transaction table: id customer amount type 1 1 10 type1 2 1 15 type1 3 1 15 type2 4 2 60 …
andho
  • 1,166
  • 1
  • 15
  • 27
2
votes
1 answer

Excel Pivot Table Calculated Field

I've a simple table with some amounts by date and product name. Month | Product | Amount ------------------------- 05-'12| Prod A | 10 05-'12| Prod A | 3 05-'12| Prod B | 4 05-'12| Prod C | 13 05-'12| Prod C | 5 …
Jason Tal
  • 21
  • 1
  • 2
2
votes
1 answer

How can I reformat a query result from 2 to 5 cols. Col1 'time' has up to 4 occurrences & Col2 'names' needs to be listed adjacent to correct time

I have a query that returns 2 columns, 1 being 'time' which is not unique and may have up to 4 occurrences. The 2nd column is a list of 'names'. If need be I can easily add a third field which is unique to this data called RegId. I want to modify…
gallie
  • 143
  • 1
  • 2
  • 9
2
votes
3 answers

MySQL - How to display row value as column name using concat and group_concat

Table 1: id | typeid | available| 0 | 1 | 12 | 0 | 2 | 44 | Table 2: typeid | typename | 1 | CL | 2 | ML | I have a query using concat and group_concat: select…
noushad
  • 165
  • 2
  • 3
  • 11
2
votes
1 answer

How do I link and excel slicer to an excel slider (scroll bar)?

Excel 2010 have a PivotTable feature called a slicer. Slicers are nice. However, when your slicing on a column with tons of unique values, slicers suck. I want to know how to tie a slicer to a "slider" (scroll bar), that way I can link a Macro to…
VISQL
  • 1,960
  • 5
  • 29
  • 41
2
votes
2 answers

MySQL: Using IF statement to pivot, but getting lots of NULL values

I have some data organized by quintile labels (-1, 1, 2, 3, 4, 5). For each of these values in a Quintile column, there is a value in another column called ret. Lastly, there is a column of dates containing month-end dates as integers. My goal is to…
ely
  • 74,674
  • 34
  • 147
  • 228