Alteryx Designer Desktop Discussions

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

Need help to convert DateDiff statement into Alteryx from SQL.

Puneet13
8 - Asteroid

I have tried to implement below status in Alteryx but it is not allowed to perform the action. Can somebody provide me the solution.

 

SQL  - convert(varchar(5),DateDiff(s, [RobotStartProcessingTime], [RobotEndprocessingTime])/3600)+':'+convert (varchar(5),DateDiff(s, [RobotStartProcessingTime], [RobotEndprocessingTime])%3600/60)+':'+convert(varchar (5),(DateDiff(s, [RobotStartProcessingTime], [RobotEndprocessingTime])%60)) as Robot_Processing_Time

 

Puneet13_0-1669188586818.png

 

4 REPLIES 4
ShankerV
17 - Castor

@Puneet13 

 

Can you please post what is the input and what is the output expected.

That will give more clarity to address the issue.

 

Many thanks

Shanker V

Puneet13
8 - Asteroid

Input - convert(varchar(5),DateDiff(s, [RobotStartProcessingTime], [RobotEndprocessingTime])/3600)+':'+convert (varchar(5),DateDiff(s, [RobotStartProcessingTime], [RobotEndprocessingTime])%3600/60)+':'+convert(varchar (5),(DateDiff(s, [RobotStartProcessingTime], [RobotEndprocessingTime])%60)) as Robot_Processing_Time

 

Output Needs to Develop in Alteryx, unable to make formula in Alteryx.

 

Puneet13_0-1669190460705.pngPuneet13_1-1669190588717.png

 

Puneet13
8 - Asteroid

Solution - tostring(DateTimeDiff( [RobotEndprocessingTime],[RobotStartProcessingTime],"hours")/3600) +":" + tostring(mod(DateTimeDiff( [RobotEndprocessingTime],[RobotStartProcessingTime],"minutes"),60 ))+":" +tostring(mod(DateTimeDiff( [RobotEndprocessingTime],[RobotStartProcessingTime],"seconds"),60) )

Felipe_Ribeir0
16 - Nebula

Hi @Puneet13 

 

Try this, it will work even for 24+ hours of difference:

 

Felipe_Ribeir0_0-1669206387373.png

 

Labels