In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Merging 3 rows with same ID into 1

bk3171
5 - Atom

Hello,

I am trying to create variance report workflow. Data for each employee is given in 3 different rows. There are hundreds of employees and even more components in this report. Need to connect it into one row. Could you give any advise how to achieve it? Example below:

 

Example input file:

 

Employee ID001 Brut de base Previous Month001 Brut de base Current Month001 Brut de base Variance001 Brut de base Precentage040 ADJUSTMENT GROSS Previous Month040 ADJUSTMENT GROSS Current Month040 ADJUSTMENT GROSS Variance040 ADJUSTMENT GROSS Precentage
077281037,384.627,688.25303.634.11    
07728103        
07728103    26.3126.970.662.51
15664302    26.3126.3100
156643025,692.315,863.79171.483.01    
15664302        

 

Output should be:

 

Employee ID001 Brut de base Previous Month001 Brut de base Current Month001 Brut de base Variance001 Brut de base Precentage040 ADJUSTMENT GROSS Previous Month040 ADJUSTMENT GROSS Current Month040 ADJUSTMENT GROSS Variance040 ADJUSTMENT GROSS Precentage
077281037,384.627,688.25303.634.1126.3126.970.662.51
156643025,692.315,863.79171.483.015,692.315,863.79171.483.01
4 REPLIES 4
PhilipMannering
16 - Nebula
16 - Nebula

It looks like you're consolidating employees by just taking any non-empty cell? You could take the max of each column grouped by employee Id in the Summarize Tool. See example attached,

image.png

PangHC
13 - Pulsar

we can use transpose and crosstab to do so. it allow any number of columns.

 

however, the sort of header may vary. hence use field info + recordID to use as temp header.

then rename via dynamic rename.

 Screenshot 2023-08-28 191736.png

jdminton
13 - Pulsar

@bk3171 definitely use Philip's answer if that works for your scenario. I was thinking there is a possibility that one or more column may contain multiple rows of data versus just being empty. If that's the case, try this workflow.

 

Snag_14ca1752.png

bk3171
5 - Atom

Thank you Philip! Works perfect

Labels
Top Solution Authors