Alteryx Designer Desktop Discussions

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

appending fixed rows after unique combination of 2 columns

srk0609
8 - Asteroid

I have a dataset and I want to add redundant data to it based on certain condition and also the data in columns seg1, Ledger, geo for new data rows should be coming from existing data.

 If Ledger field doesn’t have secondary in it Then 3 rows highlighted in yellow should be appended after all rows associated to a certain combination of seg1 and value in ledger

Example value in seg1 column is 1234 and value in ledger is 'abc.tz', for this combination there are 5 rows of data. The value in ledger column doesn’t have secondary in it hence there should 3 new lines of data added after 5 rows of exiting data.

srk0609_10-1739773597879.png

 

The values in column seg1, ledger, geo should be coming from existing data

srk0609_11-1739773597880.png

 

If Ledger field has value secondary in it Then 3 rows highlighted in green should be appended after all rows associated to a certain combination of seg1 and value in ledger

Example value in seg1 column is 5678 and value in ledger is 'abc.ir.irs.secondary' and for this combination there are 5 rows of data. The value in ledger column has secondary in it hence there should 3 new lines of data added after 5 rows of exiting data.

srk0609_12-1739773597886.png

 

The values in column seg1, ledger, geo should be coming from existing data

 

srk0609_13-1739773597887.png

 

There are 5 unique combinations for column seg1 and Ledger so there should 3 rows of data after each combination and we should populate the data based on whether secondary is present in Ledger or not

Seg1

Ledger

1234

abc.tz

5678

abc.ir

8911

abc.cy

1234

abc.tz.tzs.secondary

5678

abc.ir.irs.secondary

 

I’m attaching the dataset. There are 2 sheets in it.

Input - has existing data

Sheet 2 – data that needs to be added
output - final output

Here is how the final data should look like(Yellow and green color are only for representation purpose color is not needed in final output)

srk0609_14-1739773597892.png

 

 Can someone please explain and provide a workflow to achieve this? Thank you

2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@srk0609 
If I understand your intention correctly.
I used the Union tool after seperating the rows with Tile tool.

0217-srk0609.png

srk0609
8 - Asteroid

Hi Qiu, the values in the rows that are appended are incorrect the values of columns seg1,Ledger,Geo should not be constant they should change based on seg1, Ledger, Geo combination that is present in above rows

This the expected o/p the values of column seg1, Ledger, Geo for new rows should be coming from above rows

srk0609_1-1739827654559.png

 

This is the output you provided where the values for col seg1, Ledger, Geo are not changing they are just constant

srk0609_3-1739828089631.png

I hope I'm able to explain my issue clearly.

 

 

 

Labels
Top Solution Authors