Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

"IF" condition based on multiple criteria - Alteryx

Anjankumar2021
8 - Asteroid

Hi, pls assist on the below.

 

Input:

 

Table A

StudentTotal Marks
Samsung55
LG33
Onida18
Sony8

 

Table B

MinMaxRankS.No
00R01
15R12
610R23
1120R34
2130R45
31 R56

 

any student with greater than or equal to 31 marks considered as rank R5 .

 

Required output:

 

StudentTotal MarksRankS.No
Samsung55R56
LG33R56
Onida18R34
Sony8R23
6 REPLIES 6
Anjankumar2021
8 - Asteroid

@binuacs pls assist

alexnajm
17 - Castor
17 - Castor

Join on Range might be your best bet! Join on ranges - Alteryx Community

 

Here's an alternative too: How To: Join on Ranges in SQL and Alteryx

OTrieger
12 - Quasar

@Anjankumar2021  what have you done so far to try to get it solved?

 

There are several ways how to get it done, some are more bizarre then other.

In additional to the 2 above you as long as you know that table 2 is a fixed rating then you can write it in a Formula tool as a condition for Table 1.

Another way, again just if you are bored, it to append the 2nd table to the first one and then again use the formula tool to create conditions and then those <>= and then filter out those unneeded lines.

One more way is to create a conditions in formula tool in a batch macro and then Control parameter will be to score, get it out from the batch macro and join it to the data prior the batch macro.

There are many ways, how you can get it done, just do it ;) 

cjaneczko
13 - Pulsar

Try the following

 

 

if [Total Marks] = 0 then 'R0'
elseif [Total Marks]>= 1 and [Total Marks] <=5 then 'R1'
elseif [Total Marks]>= 6 and [Total Marks] <=10 then 'R2'
elseif [Total Marks]>= 11 and [Total Marks] <=20 then 'R3'
elseif [Total Marks]>= 21 and [Total Marks] <=30 then 'R4'
elseif [Total Marks]>= 31 then 'R5'
else Null()
endif

 

 

Then Join the Rank to the Table to get the S.No

 

image.png

binuacs
21 - Polaris

@Anjankumar2021 another option using generate record tool

image.png

grazitti_sapna
17 - Castor

Anjankumar2021


On way of doing this by calculating rank in student's table and join both the tables by rank.

Thanks

Sapna Gupta
Labels
Top Solution Authors