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: 
bobbydave
Creator III
Creator III

Qlikview Background Colour expression

Hi guys

I have a table

GroupAvg Time
Team A_x20
Team A_y10
Team A_z40
Team B_a5
Team C_a2

Avg Time is made up of an expression that sums(Total Time)/count(Volume)

So what I need to do is do is show Avg Time in either Red or Green based on below.

     for anything related to Team A_* > 4, vRed,

          for anything related to Team B_* > 1, vRed,

               for Team C_* > 2, vRed,

                    vGreen.

I've used if statements and set analysis but it doesnt like when I use Avg Time in the Set Analysis

     if( sum ({< Group = {'Team A_*'} >} Avg Time) > 4, vRed,

          if( sum( {< Group = {'Team B_*'} >} Avg Time) > 1, vRed,

                   if( sum( {< Group = {'Team C_*'} >} Avg Time) >2, vRed,

                              vGreen)))))

I've even expanded on Avg time and used the full expression instead but set analysis doesnt like the sum(Total Time)/count(Volume) expression within it.

Any ideas?

Appreciated.

1 Solution

Accepted Solutions
Not applicable

Hi Bobby

As 'Avg Time' has a space in it, I think you need to wrap it in square brackets ie. [Avg Time]

Also, to do Total Time / Volume you would need to create two separate expressions, both with set analysis ie.

Sum({<Group={'Team A_*'}>}[Total Time]) / Count({<Group={'Team A_*'}>}Volume)

Let me know if that works

James

View solution in original post

2 Replies
Not applicable

Hi Bobby

As 'Avg Time' has a space in it, I think you need to wrap it in square brackets ie. [Avg Time]

Also, to do Total Time / Volume you would need to create two separate expressions, both with set analysis ie.

Sum({<Group={'Team A_*'}>}[Total Time]) / Count({<Group={'Team A_*'}>}Volume)

Let me know if that works

James

bobbydave
Creator III
Creator III
Author

I didnt realise Set Analysis would have to be made up of two parts but makes sense as why to do so.

Thanks. This resolved my issue.