2 Replies Latest reply: Feb 7, 2013 8:52 AM by Bruno Mølgaard Geertsen RSS

    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

       

        • Re: Using images in tables
          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'))