Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
bijoylalu
Not applicable

Color by expression for two different measure in a Combo Chart

Hi,

        I have a combo Chart, with two measures and one dimension. I need to specify user-defined colors for each measure(it can be achieved by Color by expression, i guess),

    How can i use a single expression to specific color to each measure in my visualization??

    Attaching the screenshot of my existing visualization which uses default color, where measures are Actual and Budget respectively and Dimension is Month. (Using Qlik Sense 3.0)

Capture.PNG

1 Solution

Accepted Solutions
bijoylalu
Not applicable

Re: Color by expression for two different measure in a Combo Chart

Hi.

     As this capability is not available in line chart, i did an alternative to meet my requirement.

    I did the color code change in the theme files(theme.json) and its working fine.

14 Replies
Not applicable

Re: Color by expression for two different measure in a Combo Chart

Check out Steve Street's feedback on this thread

https://community.qlik.com/message/669606

bijoylalu
Not applicable

Re: Color by expression for two different measure in a Combo Chart

Actual in my requirement, I have a line chart with one Dimension(Month) and Two measures(Actual and Budget). I want to show the measure 'Actual'(Bar in the diagram) in 'Orange' color and the measure 'Budget'(Line in the diagram) in 'Blue' color. Means I need to write an expression so that it will check for measure(not the value for it).

In the above diagram, the legend shows the color blue as 'Actual' and purple as 'Budget', instead of that i want 'Orange' for actual and 'Blue' for budget.

bijoylalu
Not applicable

Re: Color by expression for two different measure in a Combo Chart

Hi.

     As this capability is not available in line chart, i did an alternative to meet my requirement.

    I did the color code change in the theme files(theme.json) and its working fine.

Not applicable

Re: Color by expression for two different measure in a Combo Chart

Bijoy- I am sure I am asking a dumb question here but where do I find these files?

bijoylalu
Not applicable

Re: Color by expression for two different measure in a Combo Chart

C:\Users\<user>\AppData\Local\Programs\Qlik\Sense\Client\themes\sense\theme.json

C:\Users\<user>\AppData\Local\Programs\Qlik\Sense\Client\themes\bleak\theme.json

C:\Users\<user>\AppData\Local\Programs\Qlik\Sense\Client\assets\external\requirejs\require.js

The above path specified is in QlikDesktop version.

   Actual "require.js" is where we need to specify the color code(Color scheme for 12 Color and 100 Color)


   The other files are where we need to specify the priority of colors.

Not applicable

Re: Color by expression for two different measure in a Combo Chart

Thank you !

Lech_Miszkiewicz
Not applicable

Re: Color by expression for two different measure in a Combo Chart

Awesome Bijoy,

now when editing require.js  there is about 5600 entries of color value, do you know which entries have to be edited?

sharing that knowledge would be very helpful

thanks Lech

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
bijoylalu
Not applicable

Re: Color by expression for two different measure in a Combo Chart

Actually i used a programming logic for this.

For Color scheme, i gave Multicolored, option -> 12 Color.

(Same can be used for "100 Color" and "8 Color")

In the above mentioned files, I searched for "12 Color" string and I found a 12 level color pattern, that matches 1 to 12 set of colors. Since in my requirement, i am using only two measures, the two color set(second line in the pattern) will be matching. So I understood those colors are showing by default. I changed it to my required color.

(All these changes are done in theme.json files). In theme.json, we were setting the color precedense.

While analyzing the reference structure, I understood that the actual color reference is going to require.js where this color code is assigning to the variable, that is used in the programming code.

Search for "12 Colors" in this file, and you will find where the default variable assignment for 12 color scheme is coded. If you find difficult to understand the logic, search for the default color you seen in theme.json file and replace it with your required color.

Restart QlikSense.

Job is done..

Lech_Miszkiewicz
Not applicable

Re: Color by expression for two different measure in a Combo Chart

Thanks,

that will do! I got it working and it is a huge benefit if you want to implement your own color schema to QlikSense charts.

regards

Lech

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.