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

Birt: vertical cross Tab page break

I'm using birt report designer for create a report: in my report i have a crossTab with dynamic number of column because i'll do a query on DB with the parameters that the user post. Using the PageBreak property of the column Area in the crossTab i…
AfanfeFana
  • 159
  • 4
  • 15
3
votes
3 answers

How to flatten a PostgreSQL result

I have experiments, features, and feature_values. Features have values in different experiments. So I have something like: Experiments: experiment_id, experiment_name Features: feature_id, feature_name Feature_values: experiment_id, feature_id,…
Bjoernsen
  • 2,016
  • 1
  • 33
  • 41
3
votes
1 answer

How to represent crosstab data in java memory to provide category movements?

I have a problem with both the loading and performing operations with crosstab(contingency table). I would like to load the data from a flat txt file (from crosstab) and store this in memory to print it as a mosiac plot later. The biggest problem…
Jacob
  • 14,949
  • 19
  • 51
  • 74
3
votes
1 answer

PostgreSQL & regexp_split_to_array + unnest

I've that kind of string Test 1|new york| X, Test 2| chicago|Y, Test 3| harrisburg, pa| Z My required result it's Column1 Column 2 Column3 Test 1 new york X Test 2 chicago Y Test 3 harrisburg,pa Z But running this…
Luigi Saggese
  • 5,299
  • 3
  • 43
  • 94
3
votes
1 answer

Postgres - Crosstab maybe?

I have a table A with 3 columns- date | type | value _________________________ 2012-01-01 | 1 | 100 2012-01-01 | 2 | 200 2012-01-02 | 1 | 200 2012-01-02 | 2 | 300 2012-01-03 | 1 | 500 2012-01-03 | 2 | 10 Is it possible to…
blue01
  • 2,035
  • 2
  • 23
  • 38
3
votes
3 answers

Division with Aggregate Functions in SQL Not Behaving as Expected

I'm trying to do some crosstabs in SQL Server 2008 R2. That part is alright, however, if I try to get percentages for each cell, I run into a problem. Here is a distilled use case: A survey where people give their favorite color and their favorite…
Jamie Jackson
  • 1,158
  • 3
  • 19
  • 34
3
votes
0 answers

crosstab column group Restriction if field have null value in ireport

cross tab column group Restriction if field have null value in ireport ex.. from Query if i getting this result. name x y z age abc 1 0 2 0 mac 2 1 1 1 when i to create cross tab with row group (Name,x) and column group…
singh758
  • 43
  • 5
3
votes
1 answer

Create table with dynamic columns

I'm working on PostgreSQL 9.1, and I have the following tables: element(element_id int, name varchar, category_id int) category(category_id int, name varchar) characteristic(characteristic_id int, name varchar, unit…
NewK
  • 343
  • 3
  • 21
3
votes
1 answer

Postgres: buckets always filled from left in crosstab query

My query looks like this: SELECT mthreport.* FROM crosstab ('SELECT to_char(ipstimestamp, ''mon DD HH24h'') As row_name, varid::text || log.varid || ''_'' || ips.objectname::text As bucket, COUNT(*)::integer As bucketvalue FROM…
aag
  • 680
  • 2
  • 12
  • 33
3
votes
5 answers

How do I convert the fields in one row into columns?

I have a table with columns such as: Cost Rate Repair 12 Repair 223 Wear 1000 Wear 666 Fuel 500 Repair 600 Fuel 450 Wear …
Alwyn Dsouza
3
votes
2 answers

Collapse rows into one column

I have a table with the following layout: ID Label Value -- ----- ----- 1 Lab1 Value1-1 1 Lab2 Value1-2 1 Lab3 Value1-3 1 Lab4 Value1-4 1 Lab5 Value1-5 1 Lab6 Value1-6 2 Lab1 Value2-1 2 …
George Hernando
  • 2,550
  • 7
  • 41
  • 61
2
votes
3 answers

SQL cross tab pivot query

I have a table as below. CaseID StatusID StageID CaseRegisterTime City 1 1 5 datetime XYZ 2 1 5 datetime ABC Now I want its Citywise count and only for only…
k-s
  • 2,192
  • 11
  • 39
  • 73
2
votes
1 answer

PostgreSQL row to columns

I'm trying to create a dynamic system that allows the users to import lists of data from Excel so I need to have dynamic columns, ex: custom_columns_table id list_id data_type column_name data .... 1 1 VARCHAR(255) …
user1252871
  • 21
  • 1
  • 1
  • 2
2
votes
1 answer

How do you do a crosstab query in Access with a fixed amount of columns

I want to pull data with an MS Access crosstab query so I can bind it to a report. When I load the page I get a Run-time error'3637': Cannot use the crosstab of a non-fixed column as a subquery. I would like a way to get back a fixed grid when I run…
user105135
2
votes
1 answer

Dynamic styling of row headers in JasperReports Crosstab

I am attempting to generate a cross tab report using JasperReports. The column contains time periods and the row contains different group by conditions. Now I need to change the styling of the row headers based on the level. For example, in the grid…
Raam
  • 10,296
  • 3
  • 26
  • 27