# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Contributor III

## integer value as hours & minutes

Hello community,

I have  a calculated expression eg : sum(hours), which returns a integer value like 197   . how can i represent it like 197:00:00 or 197:00. I tried to change the format in properties-number as timestamp for this expression. but its not working. could some one help me in solving is this issue.

thanks

Mark

1 Solution

Accepted Solutions
MVP

## Re: integer value as hours & minutes

Hi

Time is represented internally as a fraction of a day, so 0.25 is 6:00am (or 6 hours), 0.5 = 12:00 noon (or 12 hours).

Time() will format the fraction to a time of day. Interval will format the fraction as hours.

So in your case, you could use

=Interval(sum(hours) / 24)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
7 Replies
Not applicable

## Re: integer value as hours & minutes

Hi Mark

Within the chart properties, go to the 'Number' tab and select time.  This allows you to reformat the time as you see fit (select the Time radio button and adjust the Format Pattern).

I hope this helps - let me know how you get on.

Steve

Luminary

## Re: integer value as hours & minutes

Or use the maketime(sum(hours)) function.

MVP

## Re: integer value as hours & minutes

Hi

Time is represented internally as a fraction of a day, so 0.25 is 6:00am (or 6 hours), 0.5 = 12:00 noon (or 12 hours).

Time() will format the fraction to a time of day. Interval will format the fraction as hours.

So in your case, you could use

=Interval(sum(hours) / 24)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP

## Re: integer value as hours & minutes

=interval(interval#(sum(hours),'hh'),'hh:mm:ss')

Contributor III

## Re: integer value as hours & minutes

its not working, i already used this

Contributor III

## Re: integer value as hours & minutes

thanks jonathan, its working

Not applicable

## Re: integer value as hours & minutes

It sounds like the hour simply being recognised as a number.  Use the formula below - although you may want to incorporate something into your script possibly to ensure you do not have to repeat the formula within your charts.

All the best.

Community Browser