Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Interval Date Issue

Hello,

I am facing an issue with sum().

I have minutes calculated as

round(Interval(Date1-Date2,'mm')*(24*60)) as IntervalMinutes

For an data it comes 32 but when i write sum(IntervalMinutes) it shows 64.

Any idea

Labels (1)
14 Replies
anbu1984
Master III
Master III

Can you post sample app

Anonymous
Not applicable
Author

The output of Interval() is a QlikView Timestamp so 32 minutes is stored numerically as 32/60/24 which = 0.022222.... And the Round() function forces it to display as numeric decimal, which will be 0 after the rounding.

The Sum() functions though should leave it displaying in minute format, so this :

=sum ( interval ( timestamp(timestamp#('02-Dec-2014 10:42' , 'DD-MMM-YYYY hh:mm'))

- timestamp(timestamp#('02-Dec-2014 10:10' , 'DD-MMM-YYYY hh:mm'))  ,'mm' ) )

     displays an output of 32.

Given the above what is it that you wish to achieve with this expression ?

Not applicable
Author

Bill its ok i get 0.0222222 I round up it after multiplying by 24*60 and then i round off. It comes 32 Now when i use expression sum() the minutes i get 64

Not applicable
Author

@Bill Markham

Not applicable
Author

Hi King,

take a close look at your underlying data, bring in a rowno() field, I think you will find you have duplicate rows coming through, when looking at the underlying data you will only see the single row, hence the 32, but actually 2 exist which is being calculated within the sum and giving you the 64

hope that helps

Joe