Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Class Function with Max Interval?

I am using a class function that shows =class(WORKFLOW_DURATION,30,WORKFLOW_DURATION) .

I want the largest interval to show >120. Rather than 120 - 150, etc... How can I do this?

Thanks,

Cassandra

1 Solution

Accepted Solutions
sunny_talwar

Oh I understand why it is doing this:

May be try this:

Dual(

          If(WORKFLOW_DURATION <= 120, Class(WORKFLOW_DURATION, 30, WORKFLOW_DURATION), '>120'),           If(WORKFLOW_DURATION <= 120, Class(WORKFLOW_DURATION, 30, WORKFLOW_DURATION), 150)

)

View solution in original post

29 Replies
sunny_talwar

May be this:

=If(WORKFLOW_DURATION <= 120, Class(WORKFLOW_DURATION, 30, WORKFLOW_DURATION), '>120')

cbaqir
Specialist II
Specialist II
Author

Thanks, Sunny. Then how would I sort it so that >120 comes after the other intervals?

sunny_talwar

Try this:

Dual(If(WORKFLOW_DURATION <= 120, Class(WORKFLOW_DURATION, 30, WORKFLOW_DURATION), '>120'), Class(WORKFLOW_DURATION, 30, WORKFLOW_DURATION))

cbaqir
Specialist II
Specialist II
Author

That doesn't look quite right...

1-21-2016 9-05-52 AM.jpg

sunny_talwar

Oh I understand why it is doing this:

May be try this:

Dual(

          If(WORKFLOW_DURATION <= 120, Class(WORKFLOW_DURATION, 30, WORKFLOW_DURATION), '>120'),           If(WORKFLOW_DURATION <= 120, Class(WORKFLOW_DURATION, 30, WORKFLOW_DURATION), 150)

)

cbaqir
Specialist II
Specialist II
Author

Thanks, Sunny!

cbaqir
Specialist II
Specialist II
Author

Any idea why the interval shows 3 numbers? What does the middle number mean - an average or something?

1-21-2016 12-36-58 PM.jpg

sunny_talwar

I think you have specified the x to be replaced by WORKFLOW_DURATION

2016-01-21 14_43_28-New Text Object.png

Class(WORKFLOW_DURATION, 30, WORKFLOW_DURATION), '>120')


Change the third argument to make it something static (QlikView ‒ class - script and chart function)


Capture.PNG

cbaqir
Specialist II
Specialist II
Author

For some reason, I am getting the same REQUEST_ID counted multiple times and not sure why. I would only expect it to be counted once in 60-90 since the duration is 70 days. Any idea? I am thinking I need to use something like this: =class(Sum(total WORKFLOW_DURATION),30)

Dimensions:

  • dPgmPm (a group)
  • =DualIf(WORKFLOW_DURATION <= 120, Class(WORKFLOW_DURATION, 30), '>120'),  If(WORKFLOW_DURATION <= 120, Class(WORKFLOW_DURATION, 30), 120) )
  • =if(match(CUR_WORKFLOW_STEP_NAME,'Project Initiation and Design', 'Project Quality Review', 'Planning', 'Implementation', 'Close Out')>0,CUR_WORKFLOW_STEP_NAME,null())

Expression: count(DISTINCT REQUEST_ID)

1-21-2016 3-18-43 PM.jpg

1-21-2016 3-22-20 PM.jpg