Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

round off

Hi all,

I am still facing the issue with the format.

I have written this in script

num(floor( duration)/3600,'##.##') as  mytime,

duration in seconds. 

but I need  to show with two decimal

am getting output like below    I need  1274.62  like that

   

1274.621667
1012.946389
1 Solution

Accepted Solutions
sunny_talwar

My bad, try this

Interval(Floor(Now() - cmDate, 1/24), 'hh') as lefttime

View solution in original post

30 Replies
Anil_Babu_Samineni

May be this?

=Num(floor( duration)/3600,'#,##0.00')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
soniasweety
Master
Master
Author

in list box it is giving the result but when I export it is giving the same result.

so I tried

round( duration/3600)  as new

it is giving whole number

like  1274 but I want to add the two decimals to this how to include that?

required: 1274.62

Anil_Babu_Samineni

You could remove Round() to get it

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
soniasweety
Master
Master
Author

got it anil

I tried below

  round(duration/3600,0.01) as new   ----------got the correct result.

but same issue for this below expression  am unable to get the same

how can I do for this?

Interval(Now()-cmDate,'hh') as lefttime,

cmdate format is  :2017-06-30 03:04:46

PrashantSangle

Hi,

Try

round( duration/3600,0.01)


for more details check in help menu. You can do same using Floor() also.


Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar

Same issue with Interval() function? You are seeing extra decimals on export?

soniasweety
Master
Master
Author

yes sunny, still decimals

Interval(Now()-cmDate,'hh') as lefttime,    how to do for this?

sunny_talwar

May be try this

Interval(Floor(Now() - cmDate), 1/24), 'hh') as lefttime

Anil_Babu_Samineni

Or this?

Now() returns the Meridian also. So, You have to change it to same format where you are using subtract something like below

Interval(Date(Date#(Now(),'MM/DD/YYYY hh:mm:ss TT'),'YYYY-MM-DD hh:mm:ss')-cmDate,'hh') as lefttime,


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful