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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
25 views

Sort a data in a pivot table according to the number of rows on another column

My question is also the title of my query.. i hope you can help me. How do you sort a data in the pivot table in google sheets according to the number of rows you have on another column? In the image, ...
Mark's user avatar
  • 1
1 vote
0 answers
20 views

'Does not recognise [field] as a valid field name or expression' in crosstab

I have a working query which I have attempted to turn into a crosstab, and it has then failed. The original query looks at two tables to create a cumulative sum of deliveries before a date, split out ...
Spencer Barnes's user avatar
-1 votes
0 answers
13 views

I am storing pivot in a table. But before rendering the result I want match the result with a column from table which is not there in pivot result [closed]

I have table sales which has columns like store location, sales and managerId. In crosstab I'm using store as an row identifier location as category column and sales as a value column. I am storing ...
Ashwin s's user avatar
4 votes
4 answers
98 views

Create new rows based on missing grouped by values

Given the below dataframe, if rows are grouped by first name and last name, how can I find and create new rows for a group that does not have a row for every type in the types list. So in the example ...
notrly's user avatar
  • 97
0 votes
1 answer
24 views

Pivot data with mulitple columns (Col1, Col2, Col3) per record (Row1, Row2, Row3) to Row per Col

So I have data that is set up like this: Col1 Col2 Col3 Col4 Col5 Col6 Col7 Person Info1 Info2 Info3 Item1 Item2 Item3 Person1 10-12 M green ball truck book Person2 3-5 M yellow necklace doll ...
danhustonii's user avatar
1 vote
3 answers
48 views

Pivot or Melt a Pandas DataFrame

I have a DataFrame that has the following columns: 'Series Name', 'Country Name', '2000', '20001' , ..., '2018'. In 'Series Name' I have the variables that I want to analize (for example, 'PBI', '...
alter_k's user avatar
  • 11
0 votes
0 answers
19 views

Add a %Completed summary column to Excel pivot table

I have the following Excel pivot table that shows Effort by Workflow Stage for the Features in an app we are developing. There is an external column to calculate the %-Effort-Completed, which divides ...
bbains's user avatar
  • 99
0 votes
2 answers
33 views

Google sheets - create a pivot table from two different sheets (income, expenses)

I want to create a pivot table, or a report from two different G.Sheet sheets. One is income sheet, and other is expenses. On both sheets there is a same category with the same data validation (name ...
Igor K's user avatar
  • 39
0 votes
0 answers
39 views

How do you produce a 3-dimensional pivot table in plsql

I have a need to produce the following table (National Institute of Health format): I have no problem dealing with the layout but generating the 3-dimensional pl/sql data table is another thing. How ...
Timothy Dooling's user avatar
0 votes
0 answers
30 views

IS there anyway to read underlying data in an Excel pivot table in R

I have an excel workbook with a Pivot table using an embedded connection to a DB that I do not have access to. I would like to be able to read the underlying data into R or Python. I can do this by ...
Kurt Amend's user avatar
0 votes
0 answers
28 views

Get available inventory based on current inventory and new incoming inventory table using pandas

There are 2 datasets for which I am doing inventory analysis. Current Inventory Item Id Date QUANTITY Item1 14-Jan-20 100 Item2 14-Jan-20 200 Item3 14-Jan-20 500 Incoming ...
Saikip's user avatar
  • 21
0 votes
1 answer
35 views

How to rearrange data to Column, Column to Row, and Row to data

Here's the picture of my data I have a data in the first table, rearranged as so, but I want my data to look like the second table. I'm still getting responses, so as Table 1 get's larger, I want ...
sophie's user avatar
  • 1
0 votes
1 answer
38 views

How can I sort a spreadsheet by time period

I have a daily spreadsheet of transactions. I want to use a pivot table (or any tool you suggest) to get the sum of the transactions for specific periods of time. The period of time is 3 PM - 3 PM. So ...
Oliveleek's user avatar
-1 votes
1 answer
60 views

Identify SKU id's that have changed status twice in a historical table

I have a historical table which has id, date and status columns. I am trying to identify all the instances where the id's have changed from status 1(Active) to 0(Inactive) and came back to 1(Active ...
msksantosh's user avatar
0 votes
1 answer
62 views

Excel : Sum of max in pivot table

I would like to create a pivot table which displays the sum of a column depending on the time that person that can work on. I have the following data in a sheet on Excel : The workload is the time ...
Fapinski's user avatar
0 votes
0 answers
38 views

How to convert dynamic table rows to columns in postgresql

I want to convert the below table into my expected output format. Here the input is dynamic. But my code should be generic to handle dynamic input tables Input 1: key Value Id 1 Name AAAA Id 2 ...
krishna raja's user avatar
1 vote
1 answer
32 views

Pivot variables in SPSS with `CASESTOVARS` and specify the resulting column names

We regularly recieve an SPSS dataset with patients, eventnames and the dates when the questionnaires were filled-in. Each record is a patient ID and an event name and a date column for each ...
BdR's user avatar
  • 2,820
0 votes
0 answers
35 views

Wrong summation in Google Sheet pivot table subgroup using custom formula for calculated field

I have a Google Sheet with three separate tabs/sheets. Here's the minimal working example. To see the pivot table's settings 1) log in with a Google account and 2) create a copy. The sheets are: ...
Kohányi Róbert's user avatar
0 votes
0 answers
28 views

Excel Pivot Table find sum of value divided by number of days

I want to find the total sum of sales divided by the number of days of the week in that month. So for a specific month the total sales averaged for a specific day during different parts of the day. ...
Mitch's user avatar
  • 23
-1 votes
0 answers
17 views

Adding sums and averages to pivot table

I am trying to calcuate player batting averages. The only functions I've been able to find either sum all the averages or takes the average of the average, not taking into account the varying number ...
Gavin Tang's user avatar
0 votes
0 answers
14 views

Angular Pivot-Table component?

Is there any open-source/free-for-comercial-use angular UI library that includes pivot-grid? Google shows few, but all of them has "pricing" tab somewhere on the site
HeroesVII's user avatar
  • 148
0 votes
0 answers
26 views

Attendence Pivot Table in Mysql

I am doing Attendence in PHP and MYSQL. I want to show students Attendence like this format: Student Name Physics Math Science Riley Absent Late Present Dan Absent Late I want the subjects to be ...
Abdiakir Abdihaji's user avatar
0 votes
1 answer
51 views

Mysql Query / Stored procedure to fetch data column wise based on range of month selected

I select month and year with range Jan-23 to March 23. The output expected should be as shown below using mysql query or stored procedure. Jan-23 Present Jan-23Absent Feb-23Present Feb-23Absent ...
chetana's user avatar
1 vote
1 answer
26 views

Get values of conditionals from different columns in dataframe (tried pivottable)

I want to essentially make a pivot table but have it sorted very specifically. For example I want it to calculate the mean when Var2=C|Var3=2 and Var4=0. Wasn't sure how to incorporate 'or' or 'and' ...
WUPD's user avatar
  • 33
0 votes
0 answers
31 views

Pasting a pivot table into values, allowing me to edit the numbers, while maintaing the subtotal/grandtotal sum formula

I am not sure if this is possible I have this table: https://imgur.com/jqTb0Th Is it possible for me to paste this table into value, allowing me to edit the numbers for T0 and T1, while still ...
Luqman Hakim's user avatar
0 votes
0 answers
32 views

Excel pivot table : rank groups by same sub category

In a pivot table I have groups, each group has 5 same sub categories in percentages of the total of each group : cat1, cat2, cat3, cat4 and cat5, as follows : GroupA = 100% cat 1 = 23% cat 2 = 12% ...
dot314's user avatar
  • 1
0 votes
1 answer
33 views

Frequency cross tabulation with combinations of binary variables in R

I have a data frame which looks like this: df <- data.frame(dummyA=c(0,0,1,0,1), dummyB=c(1,1,0,1,1), dummyC=c(0,0,1,1,1)) > df dummyA dummyB dummyC 1 0 1 0 2 0 1 ...
HSJ's user avatar
  • 739
0 votes
0 answers
11 views

How can I apply a display filter on an Excel pivot table in python?

I'm a beginner in python. I'm using win32com.client library. I managed to display a pivot table. I would now like to apply a display filter on specific values. Can anyone help? I also tried Display ...
stackoliver's user avatar
1 vote
2 answers
53 views

split rows into columns in pandas dataframe

I have table similar to this table: id val 0 abc_1 5 1 abc_1 3 2 abc_1 7 3 abc_2 12 4 abc_2 6 5 abc_2 9 ... I want to "split" the rows into columns ...
Reut's user avatar
  • 1,573
1 vote
1 answer
82 views

Creating A Keyword Dashboard In Google Sheets With The Ability To Filter Out Types Of Conversions

I'm importing live data from Google Ads for all the accounts I manage, I want to create a dashboard that lets me look at clicks, costs, cost/conversion per keyword. However, the conversions counted in ...
James Gregg's user avatar
0 votes
1 answer
18 views

Power Bi Json Theme - Pivot Table Row Subtotal Formatting not working

I am creating a json Theme file for my company and I am stuck on the matrix table. It just doesnt take the inputs for row subtotals. Here's the code: { "name": "Test", &...
Michella's user avatar
0 votes
2 answers
31 views

Cross tabulation to include 2 other variables in the body of the crosstab

Consider these data: y b1 b2 M 1 143 1 1 B 2 152 2 1 D 3 199 3 1 A 4 155 4 1 C 5 161 1 2 D 6 166 2 2 B 7 198 3 2 C 8 195 4 2 A 9 193 1 3 A 10 154 2 3 C 11 ...
Vivek Sharma's user avatar
0 votes
1 answer
21 views

Any way to hide group totals in AG Grid Pivot Table

I'm looking to hide the number in parentheses in the AG Grid pivot tables. It's confusing in many cases and I don't see any option to get rid of it.
dmathisen's user avatar
  • 2,291
0 votes
1 answer
35 views

How to flat data by joining multiple tables

I have three tables as follows: T1: +----+--------+--------+ | id | f1 | f2 | +----+--------+--------+ | 1 | a | c | | 2 | b | d | +----+--------+--------+ T2: +----+----...
user2041057's user avatar
0 votes
3 answers
62 views

Collate Multiple Columns in Pivot Table

I'm working in a tracker where the rows are organized by project. The tracker includes columns identifying the lead and support managers for the projects, along with the # of hours per week that the ...
Scottasaurus's user avatar
2 votes
1 answer
46 views

Pandas subtraction for multiindex pivot table

I have a following data frame which I converted to pandas pivot table having two indexes "Date" and "Rating. The values are sorted in columns A, B and C. I would like to find a ...
Michael W's user avatar
0 votes
1 answer
49 views

Pandas Pivot Table returning no Values

I have a pandas data frame df that looks like this. import pandas as pd url = "https://www-genesis.destatis.de/genesisWS/rest/2020/data/tablefile?username=DEB924AL95&password=P@ssword1234&...
prashanth manohar's user avatar
2 votes
2 answers
67 views

permute the values ​of a dataframe diagonally

How can i transform the dataframe data into new_data ? I used pivot_longer and pivot_wider but i don't get what I want. data <- data.frame( ind = c("la", "lb", "lc"),...
dia05's user avatar
  • 123
2 votes
1 answer
37 views

Python code for calculation of very large adjacency matrix crashes using networkx MultiDiGraph

I need to calculate the adjacency matrix (in flat format) of a very large graph. Number nodes is 54327 and number edges is 46 million. The input are 46 million edges, so input looks like 1 6 2 7 1 6 3 ...
Eurico Covas's user avatar
0 votes
0 answers
40 views

Google Sheets Pivot Table Filter How to keep cells that have been filtered out and make it return with zero value

I'm trying to create a pivot table from this data: DATE TYPE LOCAL OUTSIDE 10-02-2023 Chocolate Room 1 10-02-2023 Milk Room 1 10-03-2023 Milk Bakery 10-03-2023 Milk Room 2 10-04-2023 Chocolate ...
loulei's user avatar
  • 1
0 votes
1 answer
82 views

How to combine dates by month in a pivot table in Google Sheets?

I have created the following example Google Sheet to illustrate the question, https://docs.google.com/spreadsheets/d/1UIwxJe0Jww3cJYM9rpZUUI1Ppf7iSr-sOootuJJgWgQ/edit?usp=sharing You'll see that I ...
Southern.Cross's user avatar
0 votes
0 answers
26 views

Pivot Table created with Power Pivot does not include all data

I have a pivot table which is created with Power Pivot and Power Query that needs to be updated every month. It is a set of monthly sales amounts by products. A new product has been recently added to ...
Johnny Gu's user avatar
0 votes
1 answer
52 views

How do I create a nested `dict` of arrays in Python? [duplicate]

I need to 'pivot' an array of arrays like this: mytable = [ [117, 12, 'wer'], [117, 23, 'hgr'], [42, 33, 'hgj'], [910, 27, 'sfr'], [910, 31, 'mhn'], [910, 98, 'wlc'], [453, ...
skeetastax's user avatar
  • 1,210
1 vote
1 answer
51 views

How do I add a filter to a pivot table grouping?

Follow up to: How do I sum a column based on separate category types, and preserve the zeros? I used 'Id' as a stand in for a bunch of columns. One of them is 'Date'. Here is my dataframe after ...
hailthedawn's user avatar
-1 votes
0 answers
20 views

Display Mysql data in columns not rows php [duplicate]

I have a table of customer purchases, date of purchase, and amount spent. I'd like to display all of the contents of the database by client and date. So looking at the table I have the client names on ...
user2843577's user avatar
1 vote
1 answer
47 views

Pandas.pivot TypeError: super(type, obj): obj must be an instance or subtype of type

I have some code that stopped working after updating pandas from 1.3.2 to 2.1.1. I do not understand why and how to solve it, as the error is unclear to me. Help me figure it. Snippet of my code: ...
Vitamin C's user avatar
  • 155
0 votes
0 answers
37 views

Pivoting a Pandas data frame from long to wide [duplicate]

I have this code from here: np.random.seed([3, 1415]) df2 = pd.DataFrame({'A': list('aaaabbbc'), 'B': np.random.choice(15, 8)}) df2 A B 0 a 0 1 a 11 2 a 2 3 a 11 4 b 10 5 b 10 6 b ...
prashanth manohar's user avatar
1 vote
1 answer
43 views

VBA to create a Pivot Table from a Variable Dataset

I have written the below code to create a Pivot Table from a variable data set, to show me how many Students have received what range of score within a certain grade. However it returns a Run time ...
ConorWJ's user avatar
  • 21
1 vote
1 answer
57 views

Macro to insert Pivot Table

I am trying to use a macro to create a pivot table. I have used the record macro and followed the steps through, but I am getting an error and not very well versed in VBA. It keeps getting hung up on ...
Cinn C's user avatar
  • 11
0 votes
1 answer
36 views

Adding data to Data model with variable range within the workbook

I have a question. How can I use a variable in this Data Model when my source data is within my workbook, but the range of the data is going to be different every month and I am not using a Table ...
Radoslav Tóth's user avatar

1
2 3 4 5
164