Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Darshan Hiranandani : Suggestions for Dynamic Transposition of Columns to Rows in Alteryx

darshanhiranandani
7 - Meteor

Hi Team,

I’m working on a data transformation task in Alteryx where I need to transpose columns to rows dynamically. The challenge is that the number of columns is variable, while the number of rows (parameters) is fixed at 35.

Here’s a summary of the requirements:

  • Current Data Structure: 35 rows and a dynamic number of columns (N).
  • Desired Output: Transpose the data so that the result has (N rows * 35 columns).

I am looking for suggestions on how to achieve this in Alteryx. Specifically, I’d appreciate guidance on:

  1. Dynamic Handling of Columns: How can I configure a workflow to handle a variable number of columns and transpose them into rows effectively?
  2. Maintaining Fixed Row Count: How can I ensure that the 35 rows (parameters) remain consistent and align correctly with the transposed columns?
  3. Workflow Configuration: Are there specific tools or techniques within Alteryx that you recommend for this type of dynamic transposition?
  4. Challenges and Best Practices: What potential challenges might I encounter with this approach, and how can I address them? Are there best practices or common pitfalls to avoid?

If anyone has experience with similar tasks or has insights into effective methods for dynamic data transposition in Alteryx, your input would be highly valuable.

Thanks in advance for your suggestions and help!

Best regards,
Darshan Hiranandani

3 REPLIES 3
apathetichell
19 - Altair

Post some data. without looking at it what i'd do would be:

transpose NORMAL. recordid. use a formula tool to take the ceil division of the (recordid-1)/35. let's call this field header. create a second field - let's call it newid - let's use the mod of ((recordid-1), 35) +1

cross tab my data. newid is my keyid. field header  is my cross tab column name. value is my value. voila.

OTrieger
12 - Quasar

Hi @darshanhiranandani 

From your data set and the requirements what is your process thoughts? How will you try to solve it, even if you do not have all the knowledge how, but which tool combinations will you use to solve it?

What have you done so far to solve the above, as if you can share it with us then we can guide you how to continue.

I'm sure that you have some ideas what can be done.

CoG
13 - Pulsar

Here is my approach to solving this problem: https://youtu.be/lTrCEbDccb4

 

Challenges: Because Alteryx works with table structures, they are column limited. Workflows with tables with over a 1000 columns will begin to run slowly.

 

Also, Cross Tab has some odd behaviors, including: Sorting Columns in alphabetical order and replacing non-alphanumeric characters with "_". The workflow addresses both of these issues, and the video explains the thought process. 

 

Also, here is the Custom Macro Tool I built for this purpose: Flip Tool - Alteryx Community

Screenshot.png

Labels