Questions tagged [crosstab]

A cross tab, also known as 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 also include the relevant language tag (python, R, sql-server etc.) on your question.

Resources:

1549 questions
0
votes
3 answers

Crosstab in mysql

i have this data | car_name | year | price | Honda | 2011 | 123 | Honda | 2012 | 124 | Suzuki | 2011 | 1234 | Suzuki | 2012 | 1235 How im gonna change this into | car_name | 2011 | 2012 | | Honda | 123 | 124 | Suzuki | 1234 |…
softboxkid
  • 877
  • 6
  • 13
  • 31
0
votes
1 answer

LINQ to Entity Cross Tab

Is it possible with LINQ to do a cross tab query to add new columns? These columns come from a second and third table and need to be converted to JSON to be displayed in a Telerik table. One table contains the name of the columns that need to be…
Mark Naber
  • 63
  • 2
  • 12
0
votes
1 answer

Expand and collapse (drilling) in cross tab BIRT

I have implemented a data cube that shows the population in each year(rows). The top grouping is on the continent and the next level of grouping is continents. I would like to place a + symbol against each continent, when clicked breaks the…
Nandish A
  • 1,645
  • 5
  • 26
  • 41
0
votes
1 answer

Rows into columns and / or crosstabbing array in php

I have this billing table from wherein I get records as per the report requirement. The array I get is like this: Array( [0] => stdClass Object ( [bid] => 3 [uid] => 2 [total_inc] => 100 [total_exp] => 55 …
-1
votes
1 answer

Show month as a row postgresql

I have this table, i call it transaction table id periode_month total_amount U1 1 1000 U1 2 1200 U1 3 1000 U1 4 1000 U2 2 1250 I'm trying to achieve this id month 1…
Boby
  • 1,131
  • 3
  • 20
  • 52
-1
votes
1 answer

How to make multi layer cross tabs in R

I am attempting to create a multi-layered cross tab in R. Currently, when using this code: NewMexico_DEM_xtab_ <- NewMexico_DEM_Voterfile %>% group_by(Sex, CountyName) %>% tally() %>% spread(Sex, n) I receive this output: My goal is to add a…
-1
votes
1 answer

How to merge crosstab info down in Access?

Not sure if this is possible but I'm hoping it is. I am using MS Access for Estate Planning for work. I've gotten to the point where I've got the data to look like this: File_Name Executor_1 Executor_2 Beneficiary_1 Beneficiary_2 Hill,…
-1
votes
1 answer

how to implement CrossTab in postgresql

I want to convert data from format a to format b in PostgreSQL, any help would be great-full. reference image with existing format
rohan
  • 9
  • 3
-1
votes
1 answer

Python - Pandas crosstab() - formatting cell values?

not sure if possible, but it would be good if I could apply a percentage format to cells resulting from pd.crosstab(), as I am using the normalize='columns' option. They are percentage results, so displaying as percentages would be nice. Can it be…
-1
votes
2 answers

How I fixed the incompatible error in PostgreSQL while pivoting?

I'm pivoting in PostgreSQL but when I run the query the output says: ERROR: return and sql tuple descriptions are incompatible SQL state: 42601 Summarizing, I want the distribution channel on raw, the year in the columns and the operative margin…
-1
votes
2 answers

Is there any function in R similar to pd.crosstab in python?

I am looking for a function in R similar to pd.crosstab in python where, I want to create contingency matrix between 2 columns based on the values of a third column's sum. Example - Column1 | Column2 | Column3 A | X | 1 A | Y …
-1
votes
1 answer

Pandas Crosstab with Percentage calculation

I have a python dataframe as below. I want to do crosstab/pivot with percentage calculation as below. owner = ['a','a','a','b','b','b','c','c','c'] user = ['a','a','a','b','b','b','c','c','c'] used_hours =…
premganesh
  • 67
  • 1
  • 9
-1
votes
2 answers

Create a pivot table using two columns treating them as a group

I have seen plenty of answers that address replicating R's dcast functionality using a single column as the index but I am having a hard time replicating a dcast where you are combining columns to group them and then pivoting. I keep running into…
-1
votes
1 answer

How to create a multi column report/ cross tab query using Microsoft access

I'm trying to achieve a report that looks similar to this using a cross tab query in Microsoft Access. Do i need to make individual queries first then join them together?
Jake
  • 1
  • 1
-1
votes
2 answers

T-SQL Crosstab count query

If have the following dataset: ... and I want to do a crosstab of sorts, counting the data against specific criteria e.g.: Colour criteria: String contains "Blue", "Red", "Yellow" or "Green" (not case sensitive) Type criteria: String contains…
sytup
  • 67
  • 1
  • 9
1 2 3
99
100