Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
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')

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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.
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,


Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)