Alteryx IO Discussions

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.
SOLVED

Multifield formula Complexity

AS
8 - Asteroid

Hi Experts,

Stuck in a complex situation where I have to use same formula in multiple field with some changes in the value. Please help me to solve this.

The first table is containing the data from 2018 to 2022 in below format -

Max DateMin DateDiff ColumnMonth
31-01-201801-01-201831Jan_2018
28-02-201801-02-201828Feb_2018
31-03-201801-03-201831Mar_2018
30-04-201801-04-201830Apr_2018
31-05-201801-05-201831May_2018
30-06-201801-06-201830Jun_2018
31-07-201801-07-201831Jul_2018
31-08-201801-08-201831Aug_2018

 

second table has some data- including formula tool

Allocation Started MonthAllocation End Month31-01-201828-02-201831-03-201830-04-201831-05-201830-06-201831-07-201830-08-2018
02-01-201820-04-201844082.842082.8 44082.8  44082.80000
14-05-201813-08-202400000256865256865256865
14-08-201913-08-202400000000

 

Single formula will applied for all column but the difference is [Max Date], [Min Date] and [Diff Column] will change according to the first table. 

 

formula for 31-01-2018 field --- IF [Allocation start month]>[Max Date] then 0, elseif [Allocation end month]<[Min Date] then 0 elseif [Allocation start month]>=[Min Date] and [Allocation start month]<=[Max Date] then [TCV] else [TCV]*[Diff Column]

 

Please help me in solving this complex logic

7 REPLIES 7
AS
8 - Asteroid

@atcodedog05 Could you please help this time?

atcodedog05
22 - Nova
22 - Nova

Hi @AS 

 

It is not very clear. What is TSV and can you provide us with an expected output?

AS
8 - Asteroid

Hi @atcodedog05 

 

To answer your question [TCV] would be the another column where I'm copying the Amount or doing calculation. But my question is divided into 2 part

1. How 1st table data rows can be bring in the formula (as you can see 2nd table column names are same as rows of first table)

2. how I can implement same formula in every field

 

The first table is containing the data from 2018 to 2022 in below format -

Max DateMin DateDiff ColumnMonth
31-01-201801-01-201831Jan_2018
28-02-201801-02-201828Feb_2018
31-03-201801-03-201831Mar_2018
30-04-201801-04-201830Apr_2018
31-05-201801-05-201831May_2018
30-06-201801-06-201830Jun_2018
31-07-201801-07-201831Jul_2018
31-08-201801-08-201831Aug_2018
and so on   

 

 

TCVAllocation Started MonthAllocation End Month31-01-201828-02-201831-03-201830-04-201831-05-201830-06-2018 31-07-2018 30-08-2018 
4408202-01-201820-04-201844082.8 44082.844082.844082.80000 
25686514-05-201813-08-202400000256865256865256865 
3434214-08-201913-08-202400000000 

 

 

formula for 31-01-2018 field --- IF [Allocation start month]>[Max Date] then 0, elseif [Allocation end month]<[Min Date] then 0 elseif [Allocation start month]>=[Min Date] and [Allocation start month]<=[Max Date] then [TCV] else [TCV]*[Diff Column]

atcodedog05
22 - Nova
22 - Nova

Hi @AS 

 

It would be something like this. Please check the formula to get accurate values

 

atcodedog05_1-1667307802215.png

 

Hope this helps : )

AS
8 - Asteroid

@atcodedog05 

Thank you so much. You are a true savior.

AS
8 - Asteroid

Thanks

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @AS 

Cheers and have a nice day!