Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to calculate value of nth row for calculation with nth-1 row or nth+1 row

AshokBhatt
7 - Meteor

How to fetch any record from the 'n' rows of data for any calculation.

E.g. If I have 100 rows of data and I want to findout the sum or difference of data of 12th row and 11th row. similarly, 13th row and 12th row dynamically.

 

Could anyone guide on this.

 

4 REPLIES 4
RodL
Alteryx Alumni (Retired)

You would use a Multi-Row Formula tool for this.

As to how to make it "dynamic", what would be the parameters that would decide this? If it is a user-entered item, you could use the Record ID to assign record numbers and then a filter on the records you are wanting. 

AshokBhatt
7 - Meteor

Thanks. I tried but seems that I am missing something to configure.Need some more support of yours.

 

The kind of output I want to generate is as below:

 

A

B

C

  

1

Start

Difference

Estimated time

  

2

12:20

00:30

12:50

 

C2=A2+B2

3

12:20

00:40

13:30

 

C3=C2+B3

4

12:20

00:35

14:05

 

C4=C3+B4

5

12:20

00:25

14:30

 

6

12:20

00:30

15:00

 

7

12:20

00:15

15:15

 

8

12:20

00:18

15:33

  

9

12:20

00:30

16:03

  

10

12:20

00:23

16:26

  
michael_treadwell
ACE Emeritus
ACE Emeritus

I have uploaded a module that uses the Multi-Row Formula tool to generate the table in your example. However, there was a bit of wizardry that had to occur with the Time fields. To add time in Alteryx it must be first converted to a DateTime.

 

1) Convert Time fields to DateTime

2) Use Multi-Row Formula to add dates according to your table

3) Convert DateTime fields back to Time

AshokBhatt
7 - Meteor

Thanks Michael.

This definitely help me for the kind of solution I was looking for which is more appropriate. Appreciate your support. 

Although, I tried some other alternate using runtotal and getting similar results but your solution is more concrete and I got kind of result what I was looking for. Thanks !

 

 

Labels
Top Solution Authors