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

Alteryx Designer Desktop Discussions

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

Calculating value based on multiple column conditioning

Ekta
8 - Asteroid

Dear All, 

I am stuck at this formula, appreciate if you can help me please.

Column A and B are already populated , we need to calculate C , D and E and each column is dependent on other columns, below is the calculation tracing for reference pls.

 

Student ABCDE
14030003000lower of A and C -  40First Row for each student = 0
112630003000-40lower of A and C  -  12640+0 = 40
14030003000-166lower of A and C -  4040+126  =166
11030003000-206lower of A and C -  10166+40 = 206
12030003000-216lower of A and C -  20206+10 =216
23030003000lower of A and C-  30First Row for each student = 0
24030003000-30lower of A and C -  4030+0 = 30
21030003000-70lower of A and C -  1030+40=70

Thank you so much in advance

 

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @Ekta 

 

Here is how you can do it.

 

Workflow:

atcodedog05_0-1628230021946.png

 

1. Using mult-row formula tool to calculate E for each group.

2. Using formula tool to calculate C and D.

 

Hope this helps : )

 

Ekta
8 - Asteroid

@atcodedog05 Thanks so much for the workflow, i would like to flag here for calculating E, we need to add 0 from E(first row) and 40 from D(first row) column.

please let me know how can we do this?

 

Best Regards

atcodedog05
22 - Nova
22 - Nova

Hi @Ekta 

 

The above solution follows a similar logic. 

 

Here is a workflow which follows exact logic.

atcodedog05_0-1628239209722.png

 

Hope this helps : )

Ekta
8 - Asteroid

@atcodedog05 Thank you so much for the workflow but some how i am not able to get the correct answer.I am trying to make some adjustments to the workflow, but no success yet:(

 

Actually, calculation need to be done rowwise, means first for row 1 for student id 1 - E=0 then C need to be calculated which is B-E  then comes D which is lower of A and C.

then we calculate row 2 where first we calculate E2 = E(row1)+D(row1) then we calculate C = B-E and then D which is lower of A and C.

similarly for row 3, first calculate E3=E(row2)+D(row2) then we calculate C = B-E and then D which is lower of A and C.

then we calculate next row and so on till last record of student id 1 and repeat the whole process for next student.

where E for student id 2 = 0

 

I am unsure what mistake i may be making.

looking forward to hearing from you.

 

Regards

atcodedog05
22 - Nova
22 - Nova

Hi @Ekta 

 

Can you share me scenarios of where its failing? I can take a look into it.

danilang
19 - Altair
19 - Altair

Hi @Ekta 

 

In future you'll find that there is much less back and forth(and it will make our job easier) if you provide the not only the rules, but also a sample of the output as well

 

Thanks

 

Dan  

Ekta
8 - Asteroid

@atcodedog05 Thank so much, i could manage to get the correct output from the workflow.

Thank you so much, Appreciate your help and guidance.

Labels