Hi Alteryx Community.
I need some help with this problem.
I have the below input.
Ratio 1 | Ratio 2 | Fruit 1 | Fruit 2 |
2 | 1 | Orange | Apple |
1.5 | 3 | Banana | Pineapple |
And I want the below output.
MAX RATIO | Fruit |
2 | Orange |
3 | Pineapple |
Basically I want to take the Fruit to be based on which Ratio is larger.
If ratio 1 is larger I want the Fruit from Fruit 1.
If ratio 2 is larger I want the Fruit from Fruit 2.
Thank you
I'm thinking using formula tool with something like.
If(Ratio 1 > Ratio 2) then Fruit 1
If(Ratio 1 < Ratio 2) then Fruit 2
Can someone comment on this please.
Hey @ericren, if it's only the 2 fields (for each of fruit and ratio) that you're comparing then yep, you could use an approach like so:
Hi @ericren
Something simple like this in the Formula tool will work for you; This way you can define what happens if neither check is true (for example if you're ratios are identical). I've set them to display 0 and null respectively but you can have them set to whatever you like.
Hi @ericren
One way of reaching the solution
Kindly accept this solution if it provided a solution to your question.
Many thanks
Shanker V
Hi, @ericren
There is a dynamic solution for you , if it can help you , please mark it as a solution and give a like.