Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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

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

View solution in original post

2 Replies
Gysbert_Wassenaar

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
Author

Thanks for your help Gysbert.

As always super quick and correct

Cheers

Bruno