We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Match a number that falls within an interval from another table

sarasustelosantos
7 - Meteor

Hi there! I am trying to finding out how to make different numbers hit a specific interval given from another table. The numbers should be rounded to the closest number and then a rank is attributed. My original dataset has 300k companies and 20 financial ratios.

 

We have two input tables that look like this:

1) Financial ratios for each company

CompanyCompany financial ratio

A

0.05
B0.14
C0.15
D0.16
E0.24

 

2)

Global financial ratioRank classification
0.051
0.12
0.23
0.34

 

Output table:

CompanyRank classification
A1
B2
C3
D3
E3

 

So the goal is to match the financial ratio for each company with a rank classification, according to the interval where it belongs. The financial ratio is rounded to the closest value.

 

Thank you in advance!

5 REPLIES 5
grazitti_sapna
17 - Castor

Hi @sarasustelosantos , you can use formula tool and  write this syntax given below

Round([Company financial ratio],0.1)

 

and then join table A and B.

 

grazitti_sapna_0-1590576967772.png

 

Please refer to the screenshot for the desired output.

 

Sapna Gupta
sarasustelosantos
7 - Meteor

Hello @grazitti_sapna , thank you for your fast reply! The workflow presented works with the data I gave in the example, however, it's a bit more complicated than that and I though Round was enough, but it's not. I really need to find the closest value. After joining the two input tables I want to find out what should be the rank classification of the company and this would be the output for company A:

 

Company Financial ratioGlobal financial ratioRank classification (global)Rank classification (company)
A0.143880.131521null
A0.143880.133752null
A0.143880.134753null
A0.143880.138064null
A0.143880.140215null
A0.143880.1465266
A0.143880.151547null

 

In order to get to the last column, I think the best way is to find the minimum value between the difference of those two columns (Financial ratio and Global financial ratio)... how can I do this in Alteryx?

grazitti_sapna
17 - Castor

@sarasustelosantos wrote:

Hello @grazitti_sapna , thank you for your fast reply! The workflow presented works with the data I gave in the example, however, it's a bit more complicated than that and I though Round was enough, but it's not. I really need to find the closest value. After joining the two input tables I want to find out what should be the rank classification of the company and this would be the output for company A:

 

Company Financial ratioGlobal financial ratioRank classification (global)Rank classification (company)
A0.143880.131521null
A0.143880.133752null
A0.143880.134753null
A0.143880.138064null
A0.143880.140215null
A0.143880.1465266
A0.143880.151547null

 

In order to get to the last column, I think the best way is to find the minimum value between the difference of those two columns (Financial ratio and Global financial ratio)... how can I do this in Alteryx?


@sarasustelosantos , could you tell me how did you find out the rank classification for the company as the whole column is null but only 2nd last row has a value 6 so a bit curious how did you find it?Also if we try to find the difference between the financial and global ratio the numbers would result in negatives.Anyways I have given a try as per my understanding. Please let me know if it works for you.

Sapna Gupta
RobertOdera
13 - Pulsar

Hi, @sarasustelosantos 

 

Please mark this as an acceptable solution, and Like, if this works for you.

 

Solution (since only one company in sample file)

RNO2_0-1590587534670.png

Workflow

RNO2_0-1590587681565.png

 

The workflow is attached.

Cheers!

sarasustelosantos
7 - Meteor

@grazitti_sapna and @RobertOdera I ended up finding what I needed and built a Macro. Thank you so much for your help anyway! Attached is macro for anyone that needs it.

Labels
Top Solution Authors