Start Free Trial

Alteryx Designer Desktop Discussions

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

Filter out duplicate values based on other categories

ZahinOsman
8 - Asteroid

Hi all,

 

I need to figure out a way to filter out duplicate values (Trade ID) but they're contingent on several other categories. There are a few scenarios; 

 

1) First scenario, I have the below table, all values are duplicate;

 

Trade IDBook CDDbo Fx Daily Trx.Trade DateTime Period.Trade DateBuy/SellCCY PairCCY1CCY2Dbo Fx Daily Trx.Counter NotionalDbo Fx Daily Trx.Settlement DateDbo Fx Daily Trx.Trade StatusPrimary Notional ValueTime Period.Settlement DateFx Trade.Trade StatusSds IdIDSap Company CDCountry CDCountry NmTrade Mnth
T123456Cheese3/8/20228-Mar-22BuyUSD-JPYUSDJPY3904311003/27/2023AMEND300000027-Mar-23AMEND42540785Bush5279SGSingapore2023-03 
T123456Cheese3/8/20228-Mar-22BuyUSD-JPYUSDJPY3904311003/27/2023AMEND300000027-Mar-23AMEND42540785Bush5279SGSingapore2023-03 

 

Since Trade ID's are duplicates, they will be filtered out. But they will need to be filtered to Tab 1, which is only for Trade ID's with only values that are duplicate for all.

 

2) For the table below, Trade ID's are duplicate, but some fields are not. "Book CD" and "Dbo Fx Daily Trx.Counter Notional" are of different values (Highlighted in pink) These will need to be filtered out to Tab 2;

Trade IDBook CDDbo Fx Daily Trx.Trade DateTime Period.Trade DateBuy/SellCCY PairCCY1CCY2Dbo Fx Daily Trx.Counter NotionalDbo Fx Daily Trx.Settlement DateDbo Fx Daily Trx.Trade StatusPrimary Notional ValueTime Period.Settlement DateFx Trade.Trade StatusSds IdIDSap Company CDCountry CDCountry NmTrade Mnth
T4513245Mochi3/8/20228-Mar-22SellUSD-JPYUSDJPY3904311003/27/2023AMEND300000027-Mar-23AMEND42540785Sally7740SGSingapore2023-03 
T4513245Bear3/8/20228-Mar-22SellUSD-JPYUSDJPY3904312003/27/2023AMEND300000027-Mar-23AMEND42540785Sally7740SGSingapore2023-03 

 

If any of these below categories are different, but the Trade ID is duplicate, then they will need to go to the same separate tab;

 

The list:

  • Book CD
  • Dbo Fx Daily Trx.Trade Date
  • Time Period.Trade Date
  • Buy/Sell
  • CCY Pair
  • CCY1
  • CCY2
  • Dbo Fx Daily Trx.Counter Notional
  • Dbo Fx Daily Trx.Settlement Date
  • Dbo Fx Daily Trx.Trade Status
  • Primary Notional Value
  • Time Period.Settlement Date
  • Fx Trade.Trade Status
  • Sds Id

 

3) Final scenario is when Trade ID and all of the categories listed below are duplicates, but categories not found in the list are not duplicates 

 

The list:

  • Book CD
  • Dbo Fx Daily Trx.Trade Date
  • Time Period.Trade Date
  • Buy/Sell
  • CCY Pair
  • CCY1
  • CCY2
  • Dbo Fx Daily Trx.Counter Notional
  • Dbo Fx Daily Trx.Settlement Date
  • Dbo Fx Daily Trx.Trade Status
  • Primary Notional Value
  • Time Period.Settlement Date
  • Fx Trade.Trade Status
  • Sds Id

 

The table below shows Trade ID and all categories above as duplicates;

Trade IDBook CDDbo Fx Daily Trx.Trade DateTime Period.Trade DateBuy/SellCCY PairCCY1CCY2Dbo Fx Daily Trx.Counter NotionalDbo Fx Daily Trx.Settlement DateDbo Fx Daily Trx.Trade StatusPrimary Notional ValueTime Period.Settlement DateFx Trade.Trade StatusSds IdIDSap Company CDCountry CDCountry NmTrade Mnth
T280338740Bird3/24/202224-Mar-22BuyUSD-CNHUSDCNH3236500003/28/2023AMEND5000000028-Mar-23AMEND40282022John5279SGSingapore2023-03 
T280338740Bird3/24/202224-Mar-22BuyUSD-CNHUSDCNH3236500003/28/2023AMEND5000000028-Mar-23AMEND40282022Megan5278SGIndia2023-03 

 

However, for the categories highlighted in orange and underlined, some of them are not duplicates.  

 

Sap Company CD
Country CD
Country Nm
Trade Mnth

 

The results from this scenario will be filtered out to Tab 3.

-----------

 

I have tried several filters/formulas but have found this to be quite challenging getting all of us done in a single step. The formula I'm currently using somehow ignores several key aspects, so I'm abit stuck here

 

Appreciate the help!

 

Best,

6 REPLIES 6
CoG
14 - Magnetar

How do you handle the case where rows fit into multiple Scenarios? Namely, something like this:

Trade IDBook CD

T1

Bear
T1Bear
T1Mochi

 

Rows 1 and 2 are total duplicates (Scenario 1), but Rows 1 & 3 and Rows 2 & 3 fit (Scenario 2)

 

I'm putting together a workflow, which is not pretty but seems to work.

CoG
14 - Magnetar

Here you are! This workflow breaks down all row associations, based on the rules that you mentioned. The data can be manipulated further to achieve results as desired.

 

Let me know if something is off or if you have further questions!

 

Filter_Duplicates.png

ZahinOsman
8 - Asteroid

Hi Andrew,

 

I think for my data set its never the case, but if it happens then it should be filtered to tab 2.

 

I'll take a look at your workflow, thank you so much for taking the time to help!

ZahinOsman
8 - Asteroid

Hey Andrew,

 

thanks again, I see what you're trying to do but I need all the information present in the filtered tabs 1/2/3. 

 

Like this;

 

Scenario 1 (the data below is taken out of the main flow of data)

Trade IDBook CDDbo Fx Daily Trx.Trade DateTime Period.Trade DateBuy/SellCCY PairCCY1CCY2Dbo Fx Daily Trx.Counter NotionalDbo Fx Daily Trx.Settlement DateDbo Fx Daily Trx.Trade StatusPrimary Notional ValueTime Period.Settlement DateFx Trade.Trade StatusSds IdIDSap Company CDCountry CDCountry NmTrade Mnth
T123456Cheese3/8/20228-Mar-22BuyUSD-JPYUSDJPY3904311003/27/2023AMEND300000027-Mar-23AMEND42540785Bush5279SGSingapore2023-03 
T123456Cheese3/8/20228-Mar-22BuyUSD-JPYUSDJPY3904311003/27/2023AMEND300000027-Mar-23AMEND42540785Bush5279SGSingapore2023-03 

 

I'll play around with your workflow to see if i can get it in my desired format

 

CoG
14 - Magnetar

Not sure if this does everything you were looking for, but here's a modified version of the workflow that joins the original records back in.

ZahinOsman
8 - Asteroid

You are Gods gift to mankind.

 

Thanks mate!!

Labels
Top Solution Authors