Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Using images in tables

Hi

I want to use a kind of traffic light in my tables with red, orange and green dots.

So far I succed in getting red and green (vCurrentYear=2013, vCurrentLastYear=2012):

=if(count({1<Year={$(vCurrentYear)}>} studenID) - count({1<Year={$(vCurrentLastYear)}>} studentID) >=0, 'qmem://<bundled>/BuiltIn/led_g.png','qmem://<bundled>/BuiltIn/led_r.png')

But I can't figure out how to make an orange dot in stead of a red dot whenever the difference is negative, but small (ex. between -1 to -10).

Also I would like to calculate the difference in percent (with the orange dot whenever -5% < Difference < 0 %) 

Can anyone help me?

Thanks in advance

Cheers

Bruno

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Not applicable

Re: Using images in tables

Try adding a nested if:

=if(count({1<Year={$(vCurrentYear)}>} studenID) - count({1<Year={$(vCurrentLastYear)}>} studentID) >=0,

     'qmem://<bundled>/BuiltIn/led_g.png',

     if(count({1<Year={$(vCurrentYear)}>} studenID) - count({1<Year={$(vCurrentLastYear)}>} studentID) < -10

          'qmem://<bundled>/BuiltIn/led_r.png',

          'qmem://<bundled>/BuiltIn/led_y.png')

     )

for the difference in % use:

=if( count({1<Year={$(vCurrentYear)}>} studenID) /count({1<Year={$(vCurrentLastYear)}>} studentID) -1 >=0,

'qmem://<bundled>/BuiltIn/led_g.png',

if( count({1<Year={$(vCurrentYear)}>} studenID) /count({1<Year={$(vCurrentLastYear)}>} studentID) -1 < -0.05

'qmem://<bundled>/BuiltIn/led_r.png','qmem://<bundled>/BuiltIn/led_y.png'))


talk is cheap, supply exceeds demand
2 Replies
Gysbert_Wassenaar
Not applicable

Re: Using images in tables

Try adding a nested if:

=if(count({1<Year={$(vCurrentYear)}>} studenID) - count({1<Year={$(vCurrentLastYear)}>} studentID) >=0,

     'qmem://<bundled>/BuiltIn/led_g.png',

     if(count({1<Year={$(vCurrentYear)}>} studenID) - count({1<Year={$(vCurrentLastYear)}>} studentID) < -10

          'qmem://<bundled>/BuiltIn/led_r.png',

          'qmem://<bundled>/BuiltIn/led_y.png')

     )

for the difference in % use:

=if( count({1<Year={$(vCurrentYear)}>} studenID) /count({1<Year={$(vCurrentLastYear)}>} studentID) -1 >=0,

'qmem://<bundled>/BuiltIn/led_g.png',

if( count({1<Year={$(vCurrentYear)}>} studenID) /count({1<Year={$(vCurrentLastYear)}>} studentID) -1 < -0.05

'qmem://<bundled>/BuiltIn/led_r.png','qmem://<bundled>/BuiltIn/led_y.png'))


talk is cheap, supply exceeds demand
Not applicable

Re: Using images in tables

Thanks for your help Gysbert.

As always super quick and correct

Cheers

Bruno