Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Transposing a column into rows with an If condition.

Jigarpanchal
5 - Atom

I have data of Car with their In and Out dates.

 

Car

Date

Access

M1

2-2-2018

In

M2

2-2-2018

In

M2

2-3-2018

Out

M1

2-3-2018

Out

M2

2-4-2018

In

M1

2-4-2018

In

M2

2-5-2018

Out

M1

2-5-2018

Out

 

I want it to be in such a manner with In and Out date for each Car in a single row, the arrangement of the Cars doesn’t matter just the In and Out should match the dataset.

 

Car

In

Out

M1

2-2-2018

2-3-2018

M2

2-2-2018

2-3-2018

M2

2-4-2018

2-5-2018

M1

2-4-2018

2-5-2018

 

Thank you.

5 REPLIES 5
LordNeilLord
15 - Aurora

Hey @Jigarpanchal 

 

You could approach it by sorting the dates and access so they are in order, then adding a multirow formula to "group" the access together. Then a simple crosstab to get the final result

 

Capture.PNG

Dazzerman
11 - Bolide

Hi Jigarpanchal,

 

My first thought was to approach this in a similar way to how LordNeilLord did, but then I thought of another way that also works while demonstrating how some of the other Alteryx tools work.  Simpler is always good, particularly if it is efficient which LordNeilLord's method is, but having other ways to achieve a problem can help in other circumstances.Jigarpanchal_query.jpg

I hope this helps, but in any case you now have two ways to solve the problem!  🙂

Jigarpanchal
5 - Atom

Hi LordNeilLord

 

Thank you for such a quick response, the solution was simple and easy to implement in my worksheet.

Jigarpanchal
5 - Atom

Hi Dazzerman,

 

The solution you provided was quite interesting and helpful, I tried implementing both the solution, both work like a charm.

Thank you again for your help and quick response really appreciate it.

Dazzerman
11 - Bolide

You're very welcome!  Happy to help.

Labels