Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
JoseGarcia
Creator III
Creator III

Formula

Hi there, 
I have a formula that validates the time when completing a specific task.
When the task is less than 4 minutes, it triggers "Process not validated".
The issue I have is that some of the tasks happen from one day to another (nights). This is makes the formula not to give an accurate result.

See the picture to illustrate.

My question is how can I solve the date problem into my formula.

= if(signature_32> MakeTime(0,5), 'Validated', 'Process-NOT-Followed' )

JoseGarcia_0-1617173005573.png

 

Labels (1)
5 Replies
morgankejerhag
Partner - Creator III
Partner - Creator III

Can the finish time be more than one day after? If it is either the same or the next day I guess you can mathematically change the finish time to one more day.

FinishTime+If(FinsihTime>StartTime, 1,0) as CalcFinishTime

JoseGarcia
Creator III
Creator III
Author

Morgan, 
thanks for your support.
Time can only go over by one day.
This is where I am.
Created new dimension 'CalcFinishTime'
Update formula: 
if(CalcFinishTime> MakeTime(0,4), 'Validated', 'Process-NOT-Followed' )

It is validating times under 4 minutes.

JoseGarcia_0-1617191102889.png

where am I going wrong?

morgankejerhag
Partner - Creator III
Partner - Creator III

You have to compare the values also (or calculate the diff in the script):

if(CalcFinishTime-StartTime > MakeTime(0,4), 'Validated', 'Process-NOT-Followed' )

JoseGarcia
Creator III
Creator III
Author

Morgan, 

used expression: 

=if(CalcFinishTime-StartTime> MakeTime(0,4), 'Validated', 'Process-NOT-Followed')

JoseGarcia_0-1617194149760.png


Could I have an issue my calcfinishtime on my script?

morgankejerhag
Partner - Creator III
Partner - Creator III

Yes, you can move that to the script so it is easy to show in the cart. The whole calculation of Process Validatet can probably be in the script and just be a field you show in the table. In this case the user can make selections on it as well.