4 Replies Latest reply: Apr 21, 2015 4:47 AM by Peter Hargreaves RSS

    How to define colours in load statement?

      Hi all,


      I have defined a palatte of nine colours which I want to use in a bar chart.


      I added the following lines in my "Main" Data Editor sheet:


      SET kBlue = ‘=rgb(77,119,171)';

      SET kBlueLight = ‘=rgb(55,164,208)';

      SET kBlueDark = ‘=rgb(47, 48, 82)';

      SET kPurple = ‘=rgb(98, 52, 127)';

      SET kGrey = ‘=rgb(96, 96, 92)';

      SET kGeen = ‘=rgb(78, 175, 69)';

      SET kYellow = ‘=rgb(245, 187, 37)';

      SET kRed = ‘=rgb(217, 34, 64)';

      SET kBlack = ‘=rgb(3, 3, 3)';

      Now, if I want to use the "colour by expression" function on my bar chart and type the following:


      IF(Sum([Diff x Amount])/Sum([Amount in Euro])<20,kRed,

        if(Sum([Diff x Amount])/Sum([Amount in Euro])<30, kYellow,

            if(Sum([Diff x Amount])/Sum([Amount in Euro])<40, kGreen,

            if(Sum([Diff x Amount])/Sum([Amount in Euro])<50, kYellow,




      QlikSense throws an "invalid field name" error. If I replace the bold colours with "standard colours" like red() it works.



      What am I doing wrong?





      ps. side note:

      Is it possible to use master measures in expressions?