# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

## Qlikview Average calculation

Hi,

somehow I got stuck with simple math. Please see attachment. I don't get why "Dur" field calculation (average, dividing) is wrong.

That field is tagged \$numeric

Viesturs

Tags (1)
8 Replies
Valued Contributor

## Re: Qlikview Average calculation

Hi,

maybe it is the group to multiply the count.

The result you are obtainng is 26847 / 4 / 86400

Not applicable

## Re: Qlikview Average calculation

Can you please explain what do you mean by "maybe it is the group to multiply the count."?

Somehow I don't get it why does Qlikview divide by that 86400?

Valued Contributor

## Re: Qlikview Average calculation

In the image I see the JobDefinitionTitle, and seems to be a cyclic group (or expression group?).

Maybe it is due to this group that you have the result/86400.

But without the qvw it is difficult to understand.

Not applicable

## Re: Qlikview Average calculation

Can you post a sample application? It will be easier to troubleshoot the issue with a qvw.

Not applicable

## Re: Qlikview Average calculation

I've attached sample file with scrambled data. You should see sample when open file (have to cycle group however).

Not applicable

## Re: Qlikview Average calculation

I can see in the sample file that you are using "Interval" function to get teh value of field Dur, which formats the expression as a time interval according to the string given as a format-code. If the format code is omitted, the time format set in the operating system is used (From qlikview Help ).

So, I don't think, the operation average and division will work in the similar way for a time interval as for any other integer/numeric value.

Not applicable

## Re: Qlikview Average calculation

Can you suggest how to get difference between two timestamps in seconds?

Not applicable

## Re: Re: Qlikview Average calculation

To get the difference between 2 timestamps you can use an expression as :

=Time(Time(time#(Date_Num,'hhmmss'),'hh:mm:ss') - Time(now(),'hh:mm:ss'),'hh:mm:ss')

Where Date_Num is the field name and I have used function Now() to get another timestamp. You can replace them with your own field names.

Hope this helps!