Alteryx Designer Desktop Discussions

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

remove last call , and First call next day

BRRLL99
11 - Bolide

Hi

I have Following data set, I would like to remove last call of that particular day and first call next day

 

01-03-2021 17:45
01-03-2021 17:49
01-03-2021 17:50
01-03-2021 17:54
02-03-2021 09:08
02-03-2021 09:12
02-03-2021 09:21
02-03-2021 09:34

 

I have Formula Tool and separated date and Time later I have used Multi row Formula

IF [Date] = [Row-1:Date] AND [Time] < [Row-1:Time]
THEN ToDateTime([Start of Call DateTime]) - ToDateTime([Row-1:Start of Call DateTime])
ELSE NULL()
ENDIF

Error: Invalid type in subtraction operator 

6 REPLIES 6
Qiu
21 - Polaris
21 - Polaris

@BRRLL99 
I think there must be a better way. 😁

0305-BRRLL99.PNG

Yoshiro_Fujimori
15 - Aurora

@BRRLL99 @Qiu 

My solution 😉

The "particular day" needs to be set in the Filter tool.

Yoshiro_Fujimori_2-1677989582386.png

 

 

 

Qiu
21 - Polaris
21 - Polaris

@Yoshiro_Fujimori 
Good one.

We can also do the decending order 😁

binuacs
20 - Arcturus

@BRRLL99 One way to do this with the Multi-Row formula

 

1. Convert the Date field into the Date format using the DateTimeParse() function

2. Create a flag based on the date difference between the adjacent rows (formula given below)

3. Filter out the flag

 

IIF(isNull([Row-1:Date1]) OR isNull([Row+1:Date1]),0,IIF(DateTimeDiff([Date1],[Row-1:Date1],'day') = DateTimeDiff([Row+1:Date1],[Date1],'day'),0,1))

binuacs_0-1678013566975.png

 

BRRLL99
11 - Bolide

you have changed date time format into date format

how can we know it is the last call for that particular day and first call the next day? 

binuacs
20 - Arcturus

@BRRLL99 I updated the workflow to sort the dates in ascending order, in that way you will see the last call of the particular day and the first call on the next day

 

binuacs_0-1678055836541.png

 

Labels