Associating persistent colors to field values using the script
The best practices say that a designer should avoid using bar charts with multi-colored bars or avoid having too many colors in any of your chart objects. But, at times, we need to cater to the demands of the organization and take an uncalled for approach to designing. The following recipe explains how to associate a distinct field value with different colors in the Qlik Sense script.
Getting ready
This recipe serves as a good example to demonstrate the use of the pick
function in the script. Perform the following steps to get started:
- Create a new Qlik Sense application and name it
Persistent Colors
. - Open the
Data load editor
. - Load the following script that contains information about the actuals and budget of four products. The script is available for download on the Packt Publishing website:
ProductsTemp: LOAD * INLINE [ Product, Actuals, Budget Footwear, 100000, 120000 Tyres, 180000, 150000 Mountain Bikes, 250000, 195000 Road Bikes...