
Contributor
2019-05-30
05:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Formatting interval with comma separtors
Hi there,
I have an expression which returns a very large number of hours and minutes e.g.
8124282:42
I want to format this like
8,124,282:42
Is there a way to achieve this with the interval format?
468 Views
2 Replies

Contributor III
2019-05-30
06:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Howdy MrMadders,
You could try num(fieldName, ‘#,##0:00’) but not sure if that works. Alternatively you could script a solution as follows:
Load part1 & part2 as newFieldName;
Load
Num(Subfield(fieldName, ‘:’, 1), ‘#,##0’ as part1,
‘:’ & subfield(fieldName, ‘:’, 2) as part2
Resident tableName;
Kind regards,
Yogi Achilleos
You could try num(fieldName, ‘#,##0:00’) but not sure if that works. Alternatively you could script a solution as follows:
Load part1 & part2 as newFieldName;
Load
Num(Subfield(fieldName, ‘:’, 1), ‘#,##0’ as part1,
‘:’ & subfield(fieldName, ‘:’, 2) as part2
Resident tableName;
Kind regards,
Yogi Achilleos
464 Views


Partner Ambassador/MVP
2019-05-30
08:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The interval format does not seem to accept a thousands sep. The workaround I can think of is to format as interval, reinterpret as number, and add the commas. I added a replace to get ':' before the minutes.
=replace(num(num#(interval(now(2) - MakeDate(2000,1,1), 'h.m')),'#,##0.00'),'.',':')
// returns 170,153:13
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
454 Views
