Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
JBO7369
Contributor
Contributor

Mit Datum und Uhrzeit rechnen

Hallo Leute,

Ich benötige eine Formel für ein KPI zu berechnen, bei der ich Differenz bilde zwischen der aktuellen Uhrzeit und  den nächsten 14 Uhr.

Ist sowas möglich?

Ich habe die Funktion now() gefunden, was denkt Ihr?

Viele n Dank und viele Grüße,

Jens

Labels (2)
3 Replies
Frank_E-W
Partner - Contributor III
Partner - Contributor III


Google Translate:
@JBO7369 wrote:
Hi Guys,

I need a formula to calculate a KPI, where I form the difference between the current time and the next 2 p.m.

Is something like this possible?

I found the now() function, what do you think?

Thank you and best regards,

Jens

If I understand your question correctly you want to calculate the time between tomorrow 2pm and right now? If so then this should do the trick:

=Interval(
	(Today()+1+maketime(14))
	-Now()
)

 

See also: 

Date and time interpretation ‒ Qlik Sense on Windows

Herr_K
Partner - Contributor
Partner - Contributor

Diese Lösung zeigt den Undershied zwischen jetzt und 2 Uhr Morgens, egal wie viel Uhr es heute ist. Wenn wir die "1" durch ein if-statement ersetzen funktioniert es doch!

=Interval(
	(Today()+ if(Date(Today(), 'hh') >= 14, 0, 1) +maketime(14))
	-Now()
)

 

Frank_E-W
Partner - Contributor III
Partner - Contributor III

Num(Today()) is always an integer, therefore (if I'm not wrong) my solution should work no matter what the time is today.