Forum Discussion

HamidBee's avatar
HamidBee
Power Participant
4 years ago
Solved

How do I create a conditional colour rule in Charticulator?

Hi Everyone,

 

I am trying to create a conditional colour rule in Charticulator that says if the value is greater than zero 'green' and if it is less than zero, 'red'. I think I the only way to do this would be to create a measure that splits the values into two categories, positive and negative. I was just wondering if anyone knows if there is another way.

 

In the video I saw the person did the following but I can only assume 'value type' here is another category which categorises the categories based on there values. Essentially a measure. Any ideas?

 

Here is the full video:

 

https://www.youtube.com/watch?v=Z8LCg4bw1DY

Any help would be greatly appreciated.

  • Hi HamidBee 

    I may be over-simplifying this, but I'd have a measure like...

    colour = IF(["your measure"] > 0, "P", "N")

     That'll create a measure that's based on "your measure" which will be "P" of your measure is positive, or "N" if negative. Use that exactly like Ruth did in her video and you should be good.

    Stuart

10 Replies

  • Burningsuit's avatar
    Burningsuit
    Resident Rockstar

    Hi HamidBee 

    Yes, as you worked out, you need a measure to drive the colour difference. In this example "value type" is a measure (P for positive N for negative) which goes into the "Fill" attribute to drive the different colours.

    Hope this helps

    Stuart

  • HamidBee's avatar
    HamidBee
    Power Participant

    I managed to find the file that the author of the video used. She created a new calculated column to say if the value is greater than 0 then "p" if it's less than 0 then "n". Is there a way that you know of doing this by creating a measure? The author of the video told me there isn't but I'm mindful of the fact that new features are always being put in.

    • Burningsuit's avatar
      Burningsuit
      Resident Rockstar

      Hi HamidBee 

      No, Ruth's right, in this case because she's graphing a column "Population change" you need a calculated column for positive or negative, so the column has one entry for each record.

      If you're graphing a measure, then you can have a measure as the colour attribute, provided there is one colour attribute for each measure value.

      You can use either columns or measures here, but you should be consistent, not mix columns and measures here.

      Hope this helps

      Stuart

      • HamidBee's avatar
        HamidBee
        Power Participant

        Okay, in my case. I am mapping dates from a calendar table onto one axis and a measure on the other axis.The measure has values that are greater than zero for some months and less than zero for other months. How would you set one colour scheme for values greater than zero and another for values less than zero? can I do this using a measure?