11,603
questions
0
votes
0
answers
19
views
How to create sub question with gtsummary in R (modalities reorganisation, pivot ...)
Hi and thanks for your help !
This is what my data looks like :
q21a
q21b
q21c
weight
year
Yes
No
Yes
1
2003
No
Yes
Yes
0.23
2022
It is extracted from a survey.
q21a = "Would you recommand to ...
2
votes
1
answer
23
views
Run Time Error 1004 'Unable to get the PivotFields property of the PivotTable class' with Data Model Pivot Table
I know this has been asked before but not in this specific case.
I already tried for about an hour with GPT 4o.
I use the following test excel: one sheet with a small table as test data.
When I ...
0
votes
4
answers
58
views
Can I use PIVOT or UNPIVOT to get the desired result and eliminate a slew of UNIONs?
I know I could easily use UNION ALL to get the results I want, but I have to generate 5 tables of each containing 15 rows of metrics/KPI.
To simplify, I have data like this:
user
sex
state
race
usr1
...
0
votes
1
answer
18
views
Is PIVOT Operator supported in Big Query Materialized view?
Trying to create a materialized view in Big Query using PIVOT operator as below
CREATE MATERIALIZED VIEW ****
PARTITION BY <COLUMN1>
AS
WITH TEST AS
(
SELECT * FROM (SELECT * FROM TABLE1 ...
0
votes
1
answer
28
views
VBA create pivot with "data is added to the Data Model"
I have the following code below.
The PivotTable is created just fine, but it does not have the "data is added to the data model" option selected. This means that I cannot use the "...
0
votes
2
answers
60
views
EXCEL VSTACK with a calculated SUM
I’ve got a pivot table with names in the rows and dates in the columns. I need to display actual count per name per week so the pivot table needs to look like the following.
I then also need to ...
4
votes
2
answers
83
views
How to fill a barplot, not according to the occurences of an element in a dataset, but according to its value in another variable? See example
Imagine having this dataset:
Country Energy_Source Twh Tot
Italy Biofuel 24.5 100
Italy Nuclear 15.4 100
Italy Gas 40.1 100
Italy Hydro 20.0 100
France ...
0
votes
0
answers
40
views
Microsoft Excel VBA does not refresh all data connections
I have a problem with a VBA in my Excel file.
The Excel file uses a data model as well as several pivot tables.
The VBA is used to refresh all data connections when the file is opened for the first ...
0
votes
0
answers
23
views
Restrict AgGrid pivot grid autoupdate functionality
I am working on a react application and there I have a below requirement.
In aggrid pivot, when i add or checked a checkbox of column then the pivot grid should not get updated immediately. I have a ...
0
votes
1
answer
76
views
Pivot when the snowflake table has more than 2 columns
I was trying to retrieve an output on Snowflake table having more than 2 columns to pivot. Below, sharing the code, expected output and the logics I have tried
create or replace table test(ID number, ...
0
votes
2
answers
38
views
Transposing row-like data in DB table
I have a table where I store data of some parameters which are read step-wise. The number of parameters to be read can vary from use-case to use-case. The dataset of one step can be identified by its ...
-1
votes
2
answers
86
views
"Error converting data type varchar to bigint" when creating pivot table
I'm (very) new to SQL and working on a mini-project as practice. I want to create a pivot table summarizing all the findings nicely but having some trouble and get an error:
Error converting data ...
0
votes
1
answer
26
views
In Excel, in the PivotTable fields List, how can I remove automatically generated month field which Excel has created by grouping a date field?
I am using a PivotTable in Excel on data from a Power Query connection. When I selected a date field from my data model by dragging it into the Rows box, Excel generated a new grouped field. Excel ...
1
vote
3
answers
49
views
I have multi-index data and need to fill NaNs in between the first and last available value per ID
I have a sample dataset like below. Please note that ['ID', 'Date'] constitute the index.
ID
Date
ValueA
ValueB
ValueC
A
01-01-2020
NaN
NaN
NaN
A
01-02-2020
1
5
7
A
01-03-2020
NaN
6
8
A
01-04-...
-1
votes
2
answers
44
views
Calculate quarter gap between each purchase
I have a table with MemberNo as Row, Year and Quarter as Column, Purchase as Value. I'm trying to calculate the total average time gap of purchase of list of members.
In this example case, Member ...
0
votes
0
answers
49
views
Excel Macro ActiveWorkbook.PivotCaches.Create ignores SourceData
Just before today, it worked pretty well.
I have created macro, that creates pivot table, but it creates from active worksheet.
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
...
1
vote
2
answers
131
views
Sql TRANSFORM with calculation time in MS Access
I'm Trying to make Sql TRANSFORM with calculation time in column in and out.
I want the answer in 1 query and I don't want to use the function in ms access because I want to use the sql in vb.net
...
0
votes
2
answers
67
views
In an Excel Pivot, is it possible to modify the subtotal values based on average values to be a sum rather than an average of all averages?
Tricky one to explain but is it possible to change the way that excel is applying subtotals to a pivot? My pivot is calculating the average earnings by Client and Source. But, when applying subtotals, ...
0
votes
1
answer
63
views
Optimizing pivot/unpivot & transform queries SQL
I need advise how to optimize my query / my pivot/unpivot actions as it's taking a lot of time for this procedure to run.
Basically I have data with a lot of values in columns. Value data is split by ...
0
votes
1
answer
23
views
Pivot on multiple columns in snowflake
I have following table in snowflake table
ID | NAME | QTY | LAYER
5026767 AB 25 1
5026767 XY 25 3
5026767 QE 50 2
5027016 TI 100 1
5027038 PP 30 1
5027038 CC ...
0
votes
2
answers
42
views
How to get a list of manually modified values of a column from a Pivot Table?
I cannot find an answer to my problem anywhere. Sometimes, by mistake, when I press the spacebar, a value in my pivot table gets replaced with empty. Once I realize this has happened, I can't ...
0
votes
1
answer
31
views
Undesired Unix timestamp automatically appended to the WebDataRocks global datasource file URL as a query parameter
I integrated the WebDataRocks pivot table with an Angular app using as shown below and set the global datasource filename URL to the filed served by a local nodejs server:
var pivot = new WebDataRocks(...
0
votes
1
answer
45
views
How to transpose these extra job_title rows into their own columns?
software im using is snowflake
I have a table of an employees job assignments with the company. They can hold multiple jobs actively at once (null in end_date). I'd like to consolidate this into 1 row:...
0
votes
1
answer
49
views
Spark SQL Streaming Join & pivot one to many joined records using joined key
I have 2 streaming data in Kafka topic, I have to join
Stream1.join(Stream2) on common key and I have already applied watermark and window for both stream at event timestamp field. I can see joined ...
0
votes
0
answers
10
views
Pivot the query result to date
I have the following data (https://i.sstatic.net/6HWG4GTB.png)
And i want to plot the data in the following format
(https://i.sstatic.net/f0wYvf6t.png)
what will the be big query
I am expecting the ...
0
votes
1
answer
54
views
Pivot Table with 1 Row to 1 Column
I have a query that outputs daily conveyor start time over a span of 7 days using the following query:
Select
format(min(case when location = 0 and scantime between getdate()-1 and getdate() then ...
0
votes
3
answers
106
views
Check workbook to see if it contains any pivot charts
Looking to simply check a workbook to see if it contains any pivot chart. No looking for anything fancy, just something that checks and tells me yes or no.
I tried to disect code but the only thing i ...
0
votes
0
answers
28
views
Creating a new slicer in Excel duplicates an existing slicer connected to another pivot chart
I have an Excel file containing many pivot charts with slicers connected to each chart.
I have noticed that when I create a new pivot chart by duplicating an earlier one (ie: by copying an earlier ...
1
vote
2
answers
48
views
from long to wide format with a new variable
I have this data in long format
library(tidyverse)
n=3
set.seed(1)
d <- tibble(y=sample(0:1,n,T),
x1=sample(1:5,n,T),
x2=sample(1:5,n,T),
x3=sample(1:5,n,T))
...
0
votes
2
answers
64
views
How to split a column into 2 different columns with condition
I have this data about brands and sellers.
Brand
BB_seller
Biotherm
Amazon
BVLGARI
3rd Party
BVLGARI
3rd Party
Carolina Herrera
Amazon
Chanel
Amazon
Chanel
Amazon
select Brand, substring([Buy ...
0
votes
0
answers
12
views
Pivot with subcategories with grouping Microsoft SQL
enter image description hereI tried to create a SQL query in Microsoft MS by using Pivot that listed people(column1) counts of food and medicine products( so in column 2 should be both types of ...
1
vote
1
answer
59
views
How do you create a pivot table group by Date and perfom calculation on 2 values in pandas
I have this data frame:
df
Node Interface Speed Band_In carrier Date
Server1 wan1 100 80 ATT 2024-06-01
Server1 wan2 100 60 Sprint ...
0
votes
2
answers
73
views
Fetch data to single row from multiple rows [closed]
I have a table with these columns and data:
cid
step
cr_time
120
S02
08-JUL-24 08.35.19.000 AM
120
S03
08-JUL-24 01.35.19.000 PM
120
S04
09-JUL-24 02.35.19.000 PM
121
S02
09-JUL-24 09.35.19.000 ...
0
votes
0
answers
37
views
Google Sheets Pivot for True (Imported data checkbox true/false)
I have a pivot that has other data and filters. I cannot filter out false. I am needing to show in the pivot checkbox that shows true only. Please help!
I've tried if formulas, counta, count, sum in ...
0
votes
0
answers
21
views
How to use PIVOT XML and subquery with Oracle SQL
I'm using Oracle 21C. I have a query that select from 3 tables and works fine with "hard-coded" dates.
Select * from
( Select
vc.last_name
, vc.first_name
, va....
0
votes
1
answer
37
views
Reshape table from long to wide using Power Query or DAX (not knowing number of columns to be added)
My question is similar to this post (How to pivot a table in excel from long to wide) except that I don't know how many columns to be add. In other words, one unique person can have more than one rows ...
0
votes
0
answers
27
views
unpivot and pivot conversion from sql server to postgres
I am trying to perforrm conversion from sqlserver script to postgres
postgres not supporting format,unpivot and pivot function is there any alternate method to convert these to postgres
select [values]...
0
votes
1
answer
361
views
Filament V3 belongstomany with pivot attribute to fill
First I am using filament form builder not panel.
My question:
I have a ManyToMany relationship in filament, and when I save the form everything works very well, the main model and these relations ...
0
votes
5
answers
71
views
How to transpose subset of columns into rows and group by remainder of rows? Excel? SQL?
We are in the early stages of migrating some data from a legacy system to a new system that seems to have some quirks.
Currently we have some data that is as follows
Name Date Award
Roger ...
0
votes
0
answers
81
views
Dependent Pivot Drop Downs
I am hoping someone can help. My search thus far has yielded no results, and I refuse to think this hasn't been released yet.
I have a Pivot of an extremely large set of data. In the filters is a ...
0
votes
0
answers
46
views
Row to column conversion in SQL - Dynamic rows [duplicate]
I am trying to convert the rows into column. However, the number of rows/ names are not predictable. it varies each time when I ran it based on my condition. Is there an easy way to pull that info.
...
0
votes
1
answer
20
views
Pivot multiple values to columns
This question may have been answeered, but I can't seem to find the right keywords to search.
current df:
index
time
value
type
test
0
0.00
0.112
A
test1
1
0.01
0.113
A
test1
0
0.00
0.112
A
test2
...
-1
votes
1
answer
63
views
Need help in Pivot table or Formatting the data
I have a scenario where I have the list of promotions by each job level by Month. In December, the promotion receivership % is 6.6% and in June 2.5% however when I include both I was expecting 9.1%. ...
0
votes
1
answer
67
views
How to unpivot a Pandas dataframe on two ID fields with multiple sets of columns
I have a pandas Dataframe that looks like this:
pid
fid
FirstReasonName
FirstReasonValue
SecondReasonName
SecondReasonValue
1
'x'
'a'
3
'b'
8.2
2
'y'
'c'
8
'd'
7
Now I want to unpivot it on pid ...
-1
votes
1
answer
35
views
Finding offending entries when pivot fails with a ValueError: Index contains duplicate entries, cannot reshape
I have a dataframe with 3 columns and datatypes: Datetime (Datetime dtype), Area (string), Value (float).
I want to pivot it so I get separate columns for each unique entry in Area.
df_pivot = pd....
1
vote
1
answer
41
views
Pandas multilevel Pivot/Transpose
I've looked thru countless examples, but I cannot figure out how to do the below.
Any tips would be greatly appreciated
Original df (note the multilevel)
Gender A B
sum ...
0
votes
1
answer
140
views
How to PIVOT data in snowflake by using ANY without having quotes for 'Column_Names'
How to PIVOT data in snowflake by using ANY without having quotes for 'Column_Names'.
CREATE OR REPLACE TEMPORARY TABLE quarterly_sales(
empid INT,
amount INT,
quarter TEXT)
AS SELECT * FROM ...
0
votes
2
answers
41
views
Google Sheets lambda or match() function?
I'm struggling with formula.. I want to sum in column K, when code in column H match code in column J. I thought I'd try a pivot table, but again something didn't work properly..?
Google Sheet example
...
0
votes
0
answers
22
views
pandas pivot multiple columns
I want this but got that
I want to transfer 2 columns at the same time, but they are directly flattened. How can I make multiple columns appear directly on the row?
import pandas as pd
ll = [
[&...
0
votes
0
answers
32
views
Access 2016 - Change multiple rows of PC numbers into columns against UserID [duplicate]
I am trying to sort a list of Users and the PCs they use.
Currently it is in the format:
User
PC
AA1
123
AA1
124
AA1
125
BB1
126
CC1
127
CC1
128
But I want it more like:
User
PC1
PC2
PC3
AA1
...