Alteryx Designer Desktop Discussions

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

Group by ID and market

keepcalm
7 - Meteor

Hi Alteryx community,

 

I have this dilemma where I am trying to create a new field where if ID number and market the same,  I need to get an amount that is within ten percent of the previous row and to include the "No" and "Yes" in row 5 and 6 in the output given they belong to the same ID & market and fall within 10 percent range.

 

Given I have multiple records, taking only these 6 records as example I would need to create a new field to help in my output. 

 

So the final output is to take amount that is within 10 percent range based on previous row regardless of "Yes" or "No". Hope I'm not complicating things but appreciate the community help. Thank you

 

 

 

ID numberMarketAmount TransactionNew field
555xyz100 
555xyz110Yes
555xyz121Yes
555xyz130No
555xyz900No
555xyz990Yes
4 REPLIES 4
Sebastiaandb
12 - Quasar

Hi @keepcalm 

I'm not 100% sure if this is what you're looking for, but it's my best guess :-).

 

Sebastiaandb_0-1635399056697.png

 

 

So the rules are:

- If ID number and Market of row 1 and row -1 are the same, compare;

- When comparing, check if the value of amount transaction on row 1 minus row -1 is equal to 10% of the transaction amount of row -1. 

 

What wasnt clear to me was if the amount had to be exactly 10%,as in your example, comparing 130 to 900 would result in over 10% but you stated is as a no, that's why i kept it at exactly 10%. Let me know if it helps!

 

Greetings,


Seb

keepcalm
7 - Meteor

hi @Sebastiaandb thanks for shedding some light.

 

if [Amount Transaction] -[Row-1:Amount Transaction ]/[Row-1:Amount Transaction ] <=0.01 then "Yes" else "No" endif

 

I am using this current formula above given there's some slight change to requirements in the percentage

If I were to use above formula where percentage is less than or equal to 1% and apply to below table, this should be reflected as "Yes" ( given the final amt is  0.0006.84) but funny is reflected as "No". Am I missing out something?

 

Amount Transaction
24,071,669.80
24,088,089.35
keepcalm
7 - Meteor

my bad @Sebastiaandb i missed out the bracket. : )

Sebastiaandb
12 - Quasar

@keepcalm haha no problem 😉

 

Here you go!

 

Sebastiaandb_0-1635407529651.png

 

Greetings,

 

Seb

 

Labels