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

Need help with row condition

bb
7 - Meteor

Hi guys, need your help on filtering the rows based on conditions. Here is my sample data.

CountryCategoryBuy/SoldModel
USOnlineBuyXACV
USOn PremiseBuyXACV
USOn PremiseBuyHSID
USOnlineSoldJVIC
USOn PremiseBuyJVIC
USHybridSoldHVUC
USOnlineSoldUTVS
USHybridBuyKVIC
USOnlineSoldIOCL
USHybridSoldIOCL
USOn PremiseBuyIOCL

 

I want to show only the rows that have same Model and are Sold then Bought again. So in this case, I want to show only the rows below from above data.

 

CountryCategoryBuy/SoldModel
USOnlineSoldJVIC
USOn PremiseBuyJVIC
USOnlineSoldIOCL
USHybridSoldIOCL
USOn PremiseBuyIOCL

 

I can only filter on duplicate value on model but I'm not sure how to filter data based on rows. I have thousands of rows of data and need to build a model that can do this. Any help would be great. Thanks!!

5 REPLIES 5
Thableaus
17 - Castor
17 - Castor

Hi @bb 

 

Here's a simple solution:

 

Solution1213290.PNG

- Record ID to keep track of rows

- Sort Fields on Country, Model and Buy/Sold condition

- Create a multi-row condition stating if Row-1 is "Sold" and Row:0 is "buy" that means there's Sold/Buy. Flag = 1.

- Filter records with that Flag

- Unique Tool to identify models.

- Join these models to the dataset by Country and Model (Get only Right part of dataset)

- Sort by Record ID to put everything back to order

 

WF appended.

 

Cheers,

 

zakellaoui
Alteryx Alumni (Retired)

Hello, 

 

Here you go, I used few tools to achieve the results. If this answers your question, please check the post as "answered" :) 

 

Thanks !! 

 

OutputDemo.JPG

zakellaoui
Alteryx Alumni (Retired)

You can optimize it by using 4 tools : - Summarize + Forumula + Join + Filter. 

output3.JPG

estherb47
15 - Aurora
15 - Aurora

Hi @bb 

Here's another approach. 

image.png

 

 

 

 

 

 

 

 

 

 

 

 

 

First, create a unique ID for each Model (many ways to do this, I like the Multi-Row approach)

Then concatenate the Buy/Sell column for each different Model

 

The records you want will contain the text "SoldBuy" in the summarized field.

 

Join back to the original data to pull the appropriate rows.


Please let me know if this works for you.

Cheers!
Esther

bb
7 - Meteor

All this approach works great guys. Thank you so much!!

Labels