
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
int to hh:mm:ss
Hi,
I am converting seconds into hh:mm:ss like
= Interval(Interval#(SUM (Value),'ss'),'hh:mm:ss')
Conversion is working fine but if value is big number it is coming in -ve.
Why it is coming -ve value? Please help/suggest some better solution.
Test:
Load * inline [
id,Value
1,1000,
2,25500000,
3,4556800000,
4,6767676767,
5,6767676767,
];
- Tags:
- qlikview_scripting
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To convert seconds into interval ('hh:mm:ss') use below expression:
interval(div(sum(Value),3600)&':'&(div(sum(Value),60)-div(sum(Value),3600)*60)&':'&mod(sum(Value),60),'hh:mm:ss')
Hope this helps.
Regards,
Andrei Kaliahin


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you really sure that you had values in seconds with these sizes?
6767676767 / 3600 / 24 / 365 = 214 years
- Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
can you attach a sample for you req?
-Amay


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To convert seconds into interval ('hh:mm:ss') use below expression:
interval(div(sum(Value),3600)&':'&(div(sum(Value),60)-div(sum(Value),3600)*60)&':'&mod(sum(Value),60),'hh:mm:ss')
Hope this helps.
Regards,
Andrei Kaliahin

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try like this
Test:
Load *,
Floor(Value/ 3600) & ':' & Floor(Mod(Value, 3600)/60) & ':' & Mod(Value, 60) AS HHMMSS
inline [
id,Value
1,1000,
2,25500000,
3,4556800000,
4,6767676767,
5,6767676767
];
Hope this helps you.
Regards,
Jagan.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrei,
The expression worked as expected . Thank you.
Regards,
Ashish


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
seems to be a limitation of the Interval#() function rather than the Interval() function:
= Interval(SUM (Value)/86400,'hh:mm:ss')
is working for me.
regards
Marco
