Alteryx Designer Desktop Discussions

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

Generate Duplicate Rows based on some condition

tamluenwai29
8 - Asteroid

Dear All, 

 

I got a excel file, and I would like to generate duplicate row based on some condition, can someone give me some advice for it? Many Thanks!

I have attached the sample dummy file in this post down below

 

 

Original Input

RecordIDF1
1Restricted
2Incomplete Record as of  16 Mar 2023
3 
4SMC No
5KB0337
6KB2158
7KB2424
8KB2436
9KB2673
10KB2793
11KB2930
12KB51XX
13 
14Restricted
15Incomplete Record as of 4 May 2022 / 13 Oct2022
16SMC No
17KB0337
18KB2158
19KB2424
20KB2436
21KB2673
22KB2793
23KB2930
24KB11XX
25KB45XX
26 
27Restricted
28Incomplete Record as of 26 Apr 2021
29 
30SMC No
31KB0337
32KB2158
33KB2424
34KB2436
35KB2673
36KB2793
37KB2930
38KB11XX
39 
40 
41Restricted
42Incomplete Record as of 10 Jan 2017
43 
44SMC No
45KB0337
46KB2158
47KB2424
48KB2436
49KB2673
50KB2793
51KB2930
52KB32XX
53 
54 
55 
56 

 

Expected Output

RecordIDDateF1
116-Mar-23Restricted
216-Mar-23Incomplete Record as of  16 Mar 2023
316-Mar-23 
416-Mar-23SMC No
516-Mar-23KB0337
616-Mar-23KB2158
716-Mar-23KB2424
816-Mar-23KB2436
916-Mar-23KB2673
1016-Mar-23KB2793
1116-Mar-23KB2930
1216-Mar-23KB51XX
1316-Mar-23 
144 May 2022 / 13 Oct2022Restricted
154 May 2022 / 13 Oct2022Incomplete Record as of 4 May 2022 / 13 Oct2022
164 May 2022 / 13 Oct2022SMC No
174 May 2022 / 13 Oct2022KB0337
184 May 2022 / 13 Oct2022KB2158
194 May 2022 / 13 Oct2022KB2424
204 May 2022 / 13 Oct2022KB2436
214 May 2022 / 13 Oct2022KB2673
224 May 2022 / 13 Oct2022KB2793
234 May 2022 / 13 Oct2022KB2930
244 May 2022 / 13 Oct2022KB11XX
254 May 2022 / 13 Oct2022KB45XX
264 May 2022 / 13 Oct2022 
2726-Apr-21Restricted
2826-Apr-21Incomplete Record as of 26 Apr 2021
2926-Apr-21 
3026-Apr-21SMC No
3126-Apr-21KB0337
3226-Apr-21KB2158
3326-Apr-21KB2424
3426-Apr-21KB2436
3526-Apr-21KB2673
3626-Apr-21KB2793
3726-Apr-21KB2930
3826-Apr-21KB11XX
3926-Apr-21 
4026-Apr-21 
4126-Apr-21Restricted
4226-Apr-21Incomplete Record as of 10 Jan 2017
4326-Apr-21 
4426-Apr-21SMC No
4526-Apr-21KB0337
4626-Apr-21KB2158
4726-Apr-21KB2424
4826-Apr-21KB2436
4926-Apr-21KB2673
5026-Apr-21KB2793
5126-Apr-21KB2930
5226-Apr-21KB32XX
5326-Apr-21 
5426-Apr-21 
5526-Apr-21 
5626-Apr-21 
3 REPLIES 3
OTrieger
12 - Quasar

@tamluenwai29 
You can create a new field that will indicate the number of needed lines, 1 or 2. Write formula with an IF function and then get this new field get populated with 1 or 2.

The contect it to Create Rows tool and set that field as a variable and then you will get the duplicate rows based on that.

binuacs
21 - Polaris

@tamluenwai29 one way of doing this

image.png

tamluenwai29
8 - Asteroid

Thank you so much !!

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels