Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Formula error

Hello All,

I am having an issue in writing a formula.

Could you please help:

If([Résolution Time] > Interval#('4', 'hh')and([Résolution Time] < Interval#('10', 'hh')),Interval#('10', 'hh')) - Interval#('4', 'hh'),0)

I think I am not doing it correctly.

Actually i need a formula which states that if the [Résolution Time] is more than 4 hours and less 10 hours, it show as 6 hours in my Excess field and if [Résolution Time] is less than 4 hours it shows as 0.

Many thanks for your usual help.

Kind Regards,

Hasvine

11 Replies
sunny_talwar

What exact error are you getting? Will it possible to share a sample?

Best,

Sunny

Not applicable
Author

the result shows 00:00 everywhere.

sunny_talwar

Give this a try and see what happens:

If([Résolution Time] > Interval#('4', 'h') and [Résolution Time] < Interval#('10', 'hh'), Interval#('6', 'h'), Interval#('0', 'h'))

Not applicable
Author

doesn't work 😞

Still shows 00:00

sunny_talwar

Can you show what's the format of [Resolution Time]? Is it a timestamp or in hours field?

maxgro
MVP
MVP

maybe

if([Résolution Time]>(4/24) and [Résolution Time]<(10/24), ....,  .....)

Not applicable
Author

Screenshot.png

Above is the screenshot of my table.

The [Resolution Time] is [Résolution en HH/MM/SS] (I am in a french speaking country).

sunny_talwar

Try this:

If(Num(Interval#([Resolution Time], 'hh:mm:ss')) > Num(Interval#('4', 'h')) and Num(Interval#([Resolution Time], 'hh:mm:ss')) < Num(Interval#('10', 'h')), Interval(Interval#('6', 'h'), 'hh:mm:ss'), Interval(Interval#('0', 'h'), 'hh:mm:ss'))

Not applicable
Author

Still same.. 😞