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

Jasper iReport Complex Crosstab Column and Row

I want to create a crosstab report with Jasper iReport that has layout like this **Date: 1 January 2012** Num Transaction Blue Red Total 1 | Bank Wire | 2 | 5 | 7 2 | Credit Card | 1 | …
Millie
  • 43
  • 1
  • 2
  • 8
2
votes
2 answers

CROSSTAB REPORT - MYSQL

I want generate a HTML report, using PHP and the following Mysql data: VIDEOS id | title 01 | video1 02 | video2 03 | video3 04 | video4 JURORS id | Name 01 | juror1 02 | juror2 03 | juror3 REVIEWS id_video | id_juror | grade 01 |…
2
votes
1 answer

R - xtabs() vs table (): drop levels AND define variable names?

I have a large dataframe and want to tabulate all variable-paris. table() and xtabs() both do this, but the problem is: xtabs() allows me to drop unused variable levels, which I need, but doesn't let me define the names of the dimensions table()…
maja zaloznik
  • 660
  • 9
  • 24
2
votes
1 answer

Why does my Postgres crosstab produce the error: 'Query-specified return tuple has 7 columns but crosstab returns 6'?

I'm using Postgres 8.4.9 and having trouble getting their crosstab to work. Here are what my data look like: rowname | bucket | bucket_value ----------------+---------------------+-------------- CL100001 10011 | 1 A01 |…
rixter
  • 1,237
  • 3
  • 19
  • 32
2
votes
1 answer

How do I write this crosstab type query in Linq (tables & data provided)

This is a simple sort of crosstab query. I am having difficulty transferring my SQL knowledge to Linq and because it is hard to test (I have not gotten linqpad running properly for WP7 development) I can't really "play" easily. CREATE TABLE…
lcj
  • 1,355
  • 16
  • 37
2
votes
1 answer

PostgreSQL and pivot tables using crosstab function

I have a problem with creating a pivot table in PostgreSQL using the crosstab() function. It works well but it produces multiple records for the same client_id. How can I avoid this? Here is the SQL: SELECT * FROM crosstab('SELECT client_id …
Gabriel Filipiak
  • 966
  • 12
  • 24
2
votes
1 answer

Survey Analysis Software

I am looking for a software to analyze survey data online. My input should be SPSS file or anything similar (I don't mind writing a small tool to format the input, we enter the data using a proprietary software). The idea is that the administrator…
Ahmad Hajou
  • 1,289
  • 5
  • 22
  • 39
2
votes
1 answer

PostgreSQL Query Help (Crosstab)

I have a table that looks like…
2
votes
2 answers

Ensure that pandas.crosstab returns a square matrix

I am currently using pandas.crosstab to generate the confusion matrix of my classifiers after testing. Unfortunately, sometimes my classifier fails, and classifies every signal as a single label (instead of multiple labels). pandas.crosstab…
arc_lupus
  • 3,942
  • 5
  • 45
  • 81
2
votes
1 answer

How to make the same crosstab line chart by using seaborn or matplotlib?

I have three columns. But I'm interested in plotting two columns with respect to each other. The datatype of the columns are datetime and object. The datetime column name is started_at and object column name is member_casual. I want…
Ibad Ullah
  • 112
  • 8
2
votes
1 answer

Add columns from joined table to crosstab query

I trying to figure out a way to generate a SQL query, to be used in a view, to generate an Excel like format for parent-child relationship. I have the following…
varijkapil13
  • 390
  • 4
  • 16
2
votes
2 answers

How to create a cross tabulation table between two variables with the counts in R?

I have a data frame with two columns that I want to cross tabulate. The data also includes the counts for the combination. I am trying to create the cross table and include those counts within the table. I am struggling to use the counts from the…
sutsabs
  • 431
  • 2
  • 11
2
votes
1 answer

Cross tabulation of two variables with averages in R?

I have the following social network dataset where participants (ego) were asked who provided social, work, and care support in their lives. Those who provided support (alter) were classified according to their relationship with ego (circle)…
2
votes
2 answers

Pivot table using crosstab and count

I have to display a table like this: Year Month Delivered Not delivered Not Received 2021 Jan 10 86 75 2021 Feb 13 36 96 2021 March 49 7 61 2021 Apr 3 21 72 Using raw data generated by this query: SELECT year, TO_CHAR(…
sparkle
  • 7,530
  • 22
  • 69
  • 131
2
votes
1 answer

Removing rows and columns if all zeros in non-diagonal entries

I am generating a confusion matrix to get an idea on my text-classifier's prediction vs ground-truth. The purpose is to understand which intents are being predicted as some another intents. But the problem is I have too many classes (more than 160),…
hafiz031
  • 2,236
  • 3
  • 26
  • 48