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.

Using formula based on table data

Davasu
6 - Meteoroid

Hi

 

I have some data which is arranged in a table in alteryx similar to the following

 123456
1NULL1020304060
2 NULL10203045
3  NULL102030
4   NULL1025
5    NULL20
6     NULL

 

the data represents the price so if you buy a 1 > 2 the price is 10 and if you buy a 1 > 6 the price is 60.

What I am then trying to check is if you buy a 1>2 and a 2>6 is this cheaper than a 1>6. In this case it would be 1>2 = 10 + 2>6 = 45 total 55 so it would be 5 cheaper.

I can do this in excel after creating the table as below, but is there a way to do this in Alteryx?

 123456DIFF   
1NULL1020304060-5-1000
2 NULL10203045 -555
3  NULL102030  1010
4   NULL1025   5
5    NULL20    
6     NULL    
6 REPLIES 6
Garrett_Stoker
8 - Asteroid

Can you provide more information about the way you want the formula array to calculate? You gave an example for one cell, but it isn't clear what the other cells are meant to represent. If you could post an Excel file with your example, it would be easier to trace what the logic is.

 

My first thought would be this could use a Multi-Row formula, but an iterative macro may be needed depending on how the formulas look.

Davasu
6 - Meteoroid

Thanks for your response.

 

I have attached an excel file showing how I am looking to get the splits to show. I did think of a multi row formula but couldn't work out how it could do the individual cell choices.

 

A macro did seem as though it could work but I haven't used them in Alteryx

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @Davasu 

 

Does the number of rows and columns vary? 

Davasu
6 - Meteoroid

Yes it will

CoG
14 - Magnetar

So are you trying to identify:

1. Whether 1 step is cheaper than 2 step process (or vice versa) from 1 > n, where n is the maximum numbered column of your dataset?

2. The minimum cost path from 1 > n, where n is the maximum number of your dataset?

3. The minimum cost path for all purchases?

Davasu
6 - Meteoroid

It might be easier to think of it as a journey with intermediate calling points and the costs associated with those journeys.

 

So we have a cost for the full journeys 1>6 2>6 etc, but we also have a cost for the individual journeys 1>2, 2 >3 etc,

 

What I am trying to look at is if it is cheaper to buy 1>2 and 2>6 than 1>6 or is it cheaper to buy 1>3 and 3>6 than 1>6 for all the intermediate journey. And then the same for 2>6 would it be cheaper to buy 2>3 and 3>6 than 2>6 etc

 

Hope that helps

 

 

Labels
Top Solution Authors