Questions tagged [pivot]
The PIVOT syntax converts row data into columnar data, and vice versa for the UNPIVOT syntax. The syntax is non-standard, and not all databases support the PIVOT syntax, but the functionality can be implemented, often using decision logic (CASE expressions, etc) and aggregate functions.
pivot
11,591
questions
-1
votes
2
answers
38
views
Fetch data to single row from multiple rows
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
14
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
16
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
17
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 ...
-1
votes
0
answers
13
views
I want to make pine script right and I want help from you [closed]
I have no experience in writing codes. I am trying to combine several indicators by overlaying their scripts into one common one, but it constantly gives me an error. Find out if it is even possible ...
0
votes
0
answers
20
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
47
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
56
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
39
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
16
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
58
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
2
answers
59
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
29
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
37
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 ...