Forum Discussion

Silvard's avatar
Silvard
Resolver I
1 year ago
Solved

Datediffence with iterator

Hi,

 

I need a measure for:

1. The averagex datedifference in Table 1 between Started when Process = 1 and End when Process = 3.

2. Type in table 2 should not be Yes.

 

If you're solution involves Calculate with Max, please double check that it's in fact working within a row context.

 

I have created some visuals below that should explain the situation. Please keep in mind that my table has 100000's of rows and for simplicity, I have put the Process column as numbers, whereas it's really Process Steps (there are many for each ID) and text based.

 

Table1

ID

Process

Started

End

A

0

20/01/2024

21/01/2024

A

1

24/01/2024

25/01/2024

A

2

26/01/2024

27/01/2024

A

3

30/01/2024

03/02/2024

B

0

20/01/2024

22/01/2024

B

1

25/01/2024

26/01/2024

B

2

27/01/2024

29/01/2024

B

3

31/01/2024

03/03/2024

C

0

01/10/2024

01/14/2024

C

1

02/02/2024

07/02/2024

C

2

10/02/2024

12/02/2024

C

3

13/02/2024

15/02/2024

C

4

16/02/2024

17/02/2024

C

5

19/02/2024

24/02/2024

D

0

02/25/2024

03/03/2024

D

1

03/04/2024

10/04/2024

D

2

11/04/2024

16/04/2024

D

3

20/04/2024

28/04/2024

D

4

28/04/2024

29/04/2024

    
    

Table2

  

ID

Type

  

A

No

  

B

No

  

C

Yes

<-- Exclude

 

D

No

  
    
    

Desired Result

ID

Started

End

Average DateDiff

A

24/01/2024

03/02/2024

10

B

25/01/2024

03/03/2024

38

D

03/04/2024

28/04/2024

25

   

24

 

Your help and assistance is much appreciated.

1 Reply