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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

interval statement in if clause

I have an interval statement that works fine on it's own but when I put it into an if clause it will give me days rather than minutes

Median (If(MeasureDenominator = 1 and MeasureGroup = 'ED', Interval(MeasureNumerator, 'm'))) will give me an answer in minutes but

If(MeasureGroup = 'ED', Median(If(MeasureDenominator = 1, Interval(MeasureNumerator, 'm'))), Sum(IF(MeasureDenominator = 1, MeasureNumerator))) gives me the correct number for the sum option, but if it is the interval it comes out in days not minutes.

Any ideas why this is not working?  I'm wondering if I need to use set analysis, but I was not able to get the syntax right for that.  Any help would be greatly appreciated.

Labels (1)
1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You are mixing two different display formats -- Interval and Numeric -- in the same field. This is not possible, QV is choosing the numeric format for all values.

You can preserve the interval minutes formatting by  converting to strings. Add a text() function around the interval(). You may have to do the same for the Sum().  You will lose the correct internal numeric values, which may be acceptable for your app.

-Rob

http://robwunderlich.com