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

Alteryx Designer Desktop Discussions

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

Creating multiple rows in the same column depending on the condition

nkrupabd
8 - Asteroid

Hi I'm trying to create a column Type based on the condition like if the employee is working for Day then there should be a row named days in column type and if the same employee is doing overtime as well we need another row with hours in the same type column and the overtime hours need to be summed and updated in the hours column. could anyone please help me on how do i move forward with this . Attaching an example input and output. Thank you

INPUT

nkrupabd_0-1632200637747.png

OUTPUT

nkrupabd_1-1632200667343.png

 

7 REPLIES 7
RolandSchubert
16 - Nebula
16 - Nebula

Hi @nkrupabd ,

 

if I got you right, you need an additional column [Type], that has to be calculated depending on the [Overtime] column (if [Overtime] > 0 -> hours, else days).
Then you have to aggregate by Employee and Type, but aggregation seems to be only applied to overtime, not to day shift.

 

2021-09-21_08-03-10.jpg

 

I've created a sample workflow, let me know if it works as expected.

 

Best,

 

Roland

nkrupabd
8 - Asteroid

Thank you for the response, i just gave an example there are many such conditions which need to be applied and have to be used as each row for each condition in the same column.

IN the example i mentioned the column is TYPE and need rows of the column with days and hours , for same employee there need to be different rows depending on the condition.

 

RolandSchubert
16 - Nebula
16 - Nebula

That would lead to a more complex condition (or nested conditions), but it should be no problem using a formula. Could you provide more details or sample data? 

nkrupabd
8 - Asteroid

Sure Attaching an example .

example is the input file

example out is how the output is expected to be.

Thank you

Christina_H
14 - Magnetar

This actually looks like a simple job for the Transpose tool.

Christina_Hurrell_0-1632217550664.png

I wasn't sure what your default values should be for days/nights so I've used a sum, but you can change that in the Summarize tool.

Pravallika20
8 - Asteroid

Hi @nkrupabd ,

 

Please try the following steps.

Pravallika20_0-1632221379383.png

 

Pravallika20_1-1632221422684.png

hope this helps

nkrupabd
8 - Asteroid

Thank you.

Labels
Top Solution Authors