Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

correct format

Hi all,

I want to set it to  timestamp format like   hh:mm:ss  how can I achieve this?

usning this :

if([Timestamp Num]> $(vToday), (Fabs($(vToday) - [Timestamp Num])))

variable -vToday:   =num(Timestamp(Now(),'MM/DD/YYYY hh:mm:ss'))

current output:  0.07 ,0.10  like that

required output:  01:20:01    like this [its example output]

1 Solution

Accepted Solutions
soniasweety
Master
Master
Author

working this sunny

if([Timestamp Num]> $(vToday), Interval(Fabs($(vToday) - [Timestamp Num]),'hhh:mm:ss'))

View solution in original post

18 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Sony,

Your variable vToday is formating the timestamp as a number with num().

Try taking it out and see the result.


Felipe.

sunny_talwar

Do you need the current time?

LET vToday = Time(Frac(Now()), 'hh:mm:ss');

soniasweety
Master
Master
Author

after removing it is giving null 

soniasweety
Master
Master
Author

no sunny its giving null

sunny_talwar

It is giving null? that can't be true.... I tried and it is working well

Capture.PNG

felipedl
Partner - Specialist III
Partner - Specialist III

Hi sony,

Putting the formula into a text box:

=Timestamp(Now(),'hh:mm:ss')

gives the followingSample.png !

felipedl
Partner - Specialist III
Partner - Specialist III

It's probably giving null because his condition for


if([Timestamp Num]> $(vToday), (Fabs($(vToday) - [Timestamp Num])))

isn't met.

sunny_talwar

Oh I see... I guess this will now need to use a single quote around the variable

if([Timestamp Num]> '$(vToday)', (Fabs('$(vToday)' - [Timestamp Num])))

soniasweety
Master
Master
Author

this also no luck I don't know why