Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ghaliabed
Partner - Creator
Partner - Creator

Coloring measures based on a calculated dimensions

Hello

 

I have a bar chart with a calculated dimension and a measure.

The calculated dimensions is basically:

If(Status='Closed' or Status='Rejected', 'Removed', 'Accepted')

Measure:

Count(Incident)

 

I am trying to have a custom coloring for the two calculated status and i have tried the 'By Expression' option like the following:

If(Status='Closed' or Status='Rejected', Red(), Blue() )

ghaliabed_0-1651135092716.png

 

So far this is not working and i am just getting blank colors for the measure groupings

 

ghaliabed_2-1651135134076.png

 

This is being done by end users in self-service mode which is why i do not want to just add these new status values in the data model.

Labels (2)
1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

Hello,

 

In that case your only option is to submit a feature request [1]. I understand that it is not optimal to wait for such feature, but as you can see natively only the above workarounds are available. 

 

---

[1] https://community.qlik.com/t5/Knowledge-Base/How-To-Submit-Feature-Requests-For-Qlik-Products/ta-p/1...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

4 Replies
Andrei_Cusnir
Specialist
Specialist

Hello,

 

There is a workaround that you can do to resolve this issue, but you will have to use custom themes. Here are the steps that I have followed:

 

1. I have created the chart as you have but with demo data:

 

2. Now if you go to Appearance > Colors and legend > By dimension you will see that there are only 2 color schemes available:

 

3. Now follow the instructions here [1] to create a custom theme

4. More specifically we are interested in the custom color schemes (pallets) [2]. You can find that section under Palettes

5. My custom pallets colors part in JSON properties looks like that:

 

I have created just 2 colors (Red and Green)

6. Load the custom theme in your Qlik Sense App and you will notice that now the color schemes have changed to:

 

7. After that you can see that applying that color scheme on the chart will give you the output:

 

8. The only issue is that "Failed" is presented with green and "Success" is presented with red. To resolve this issue you can either change the order of the colors in the custom theme code, or you can go to Edit sheet > Select chart > Sorting and change the sorting, so that Failed will appear second instead of first in the list, therefore the second color will be applied. 

 

Final output is:

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members. 
 

---

[1] https://help.qlik.com/en-US/sense-developer/May2021/Subsystems/Extensions/Content/Sense_Extensions/C...

[2] https://help.qlik.com/en-US/sense-developer/May2021/Subsystems/Extensions/Content/Sense_Extensions/C...

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂
vchuprina
Specialist
Specialist

Hi,

Maybe you can just modify the calculated dimension and select colors for the values

vchuprina_0-1651146533123.png

and then select colors by dimension

vchuprina_1-1651146658438.png

 

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
ghaliabed
Partner - Creator
Partner - Creator
Author

thnx guys for the suggestions.

But both dont fully work for my case as its meant to be a self-service use case for a business user.

The custom theme coloring will require a big intervention form dev and if i understood correctly will impact all chart objects.

For the colors of the calculated dimension that would work if they are stored as master items.

Sorry if i was not clear in that, this dimension is created by a business user in their community sheet, so moving the logic and coloring to a master item will require a dev intervention, and this dimension does not fit criteria of a master item as we do not want it as an official dimension of the application.

Current the self-service user just created it and is using it in their own charts and sheets.

 

I was looking for a way to do this from a pure self-service standpoint , so from the community sheet level only.

 

Andrei_Cusnir
Specialist
Specialist

Hello,

 

In that case your only option is to submit a feature request [1]. I understand that it is not optimal to wait for such feature, but as you can see natively only the above workarounds are available. 

 

---

[1] https://community.qlik.com/t5/Knowledge-Base/How-To-Submit-Feature-Requests-For-Qlik-Products/ta-p/1...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂