2 Replies Latest reply: Jan 30, 2013 8:54 AM by Dan-Ketil Jakobsen RSS

    Setting background color

    Dan-Ketil Jakobsen

      Hi

       

      I want to set the background color based on an expersion result.

      After googling and trial and error I am at a stand still with errors...

       

      This is basicly what I want to do

      If((sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)) >= 4.5, LightRed(),

          If((sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)) < 4.5, Brown(),   

                  If((sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)) < 3.0, LightGreen(),

                          If((sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)) < 1.0, LightBlue()

                              ,Yellow())

                         

                      )

             )

      )

       

      But it ony return the first parameter correct. Those that fit into >= 4.5 is correct, all the rest stopped at second check and turns brown

      To make sure it understood the between settings I changed it. Andalso just in case it was sequential I also changed the order.

      But still the same resul. >= 4.5 is ok, the rest now is either Lightblue or yellow.

       

      //Alle som er over 4.5

      If((sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)+0.000000001) >= 4.5, LightRed(),

       

      //Alle som er mindre mellom 0.9 og 0.1

          If((sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)+0.000000001) <= 0.9 or (sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)+0.000000001) >= 0.1, LightBlue(),   

         

      //Alle som er mindre mellom 2.9 og 1.0

                  If((sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)+0.000000001) <= 2.9 or (sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)+0.000000001) >= 1, Green(),

                 

      //Alle som er mindre mellom 4.5 og 3.0           

                          If((sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)+0.000000001) < 4.5 or (sum(TO_EACH)/sum({$<UOM={'PL'}>} RATIO_DEN)+0.000000001) > 3, Brown()

                         

      //Alt annet                   

                              ,Yellow())

                         

                      )

             )

      )

       

       

       

      Any suggestions on how to solve?

       

      BR Dan