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
RecordID | F1 |
1 | Restricted |
2 | Incomplete Record as of 16 Mar 2023 |
3 | |
4 | SMC No |
5 | KB0337 |
6 | KB2158 |
7 | KB2424 |
8 | KB2436 |
9 | KB2673 |
10 | KB2793 |
11 | KB2930 |
12 | KB51XX |
13 | |
14 | Restricted |
15 | Incomplete Record as of 4 May 2022 / 13 Oct2022 |
16 | SMC No |
17 | KB0337 |
18 | KB2158 |
19 | KB2424 |
20 | KB2436 |
21 | KB2673 |
22 | KB2793 |
23 | KB2930 |
24 | KB11XX |
25 | KB45XX |
26 | |
27 | Restricted |
28 | Incomplete Record as of 26 Apr 2021 |
29 | |
30 | SMC No |
31 | KB0337 |
32 | KB2158 |
33 | KB2424 |
34 | KB2436 |
35 | KB2673 |
36 | KB2793 |
37 | KB2930 |
38 | KB11XX |
39 | |
40 | |
41 | Restricted |
42 | Incomplete Record as of 10 Jan 2017 |
43 | |
44 | SMC No |
45 | KB0337 |
46 | KB2158 |
47 | KB2424 |
48 | KB2436 |
49 | KB2673 |
50 | KB2793 |
51 | KB2930 |
52 | KB32XX |
53 | |
54 | |
55 | |
56 |
Expected Output
RecordID | Date | F1 |
1 | 16-Mar-23 | Restricted |
2 | 16-Mar-23 | Incomplete Record as of 16 Mar 2023 |
3 | 16-Mar-23 | |
4 | 16-Mar-23 | SMC No |
5 | 16-Mar-23 | KB0337 |
6 | 16-Mar-23 | KB2158 |
7 | 16-Mar-23 | KB2424 |
8 | 16-Mar-23 | KB2436 |
9 | 16-Mar-23 | KB2673 |
10 | 16-Mar-23 | KB2793 |
11 | 16-Mar-23 | KB2930 |
12 | 16-Mar-23 | KB51XX |
13 | 16-Mar-23 | |
14 | 4 May 2022 / 13 Oct2022 | Restricted |
15 | 4 May 2022 / 13 Oct2022 | Incomplete Record as of 4 May 2022 / 13 Oct2022 |
16 | 4 May 2022 / 13 Oct2022 | SMC No |
17 | 4 May 2022 / 13 Oct2022 | KB0337 |
18 | 4 May 2022 / 13 Oct2022 | KB2158 |
19 | 4 May 2022 / 13 Oct2022 | KB2424 |
20 | 4 May 2022 / 13 Oct2022 | KB2436 |
21 | 4 May 2022 / 13 Oct2022 | KB2673 |
22 | 4 May 2022 / 13 Oct2022 | KB2793 |
23 | 4 May 2022 / 13 Oct2022 | KB2930 |
24 | 4 May 2022 / 13 Oct2022 | KB11XX |
25 | 4 May 2022 / 13 Oct2022 | KB45XX |
26 | 4 May 2022 / 13 Oct2022 | |
27 | 26-Apr-21 | Restricted |
28 | 26-Apr-21 | Incomplete Record as of 26 Apr 2021 |
29 | 26-Apr-21 | |
30 | 26-Apr-21 | SMC No |
31 | 26-Apr-21 | KB0337 |
32 | 26-Apr-21 | KB2158 |
33 | 26-Apr-21 | KB2424 |
34 | 26-Apr-21 | KB2436 |
35 | 26-Apr-21 | KB2673 |
36 | 26-Apr-21 | KB2793 |
37 | 26-Apr-21 | KB2930 |
38 | 26-Apr-21 | KB11XX |
39 | 26-Apr-21 | |
40 | 26-Apr-21 | |
41 | 26-Apr-21 | Restricted |
42 | 26-Apr-21 | Incomplete Record as of 10 Jan 2017 |
43 | 26-Apr-21 | |
44 | 26-Apr-21 | SMC No |
45 | 26-Apr-21 | KB0337 |
46 | 26-Apr-21 | KB2158 |
47 | 26-Apr-21 | KB2424 |
48 | 26-Apr-21 | KB2436 |
49 | 26-Apr-21 | KB2673 |
50 | 26-Apr-21 | KB2793 |
51 | 26-Apr-21 | KB2930 |
52 | 26-Apr-21 | KB32XX |
53 | 26-Apr-21 | |
54 | 26-Apr-21 | |
55 | 26-Apr-21 | |
56 | 26-Apr-21 |
@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.
@tamluenwai29 one way of doing this
Thank you so much !!
User | Count |
---|---|
18 | |
14 | |
10 | |
6 | |
6 |