Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
kumar2
Contributor III
Contributor III

modify the color based on the calculated dimension in published application

Hi

We have requirement where we are unable to create the master dimensions because we are using the published data model and creating the Reports on the published data.

Please find the below sample data:

StageRiskCalculated(Dimension)
1 Cancelled
2 Secured
5AUnsecured with Risk
6BUnsecured with Risk
7 Completed
4 Secured
5 Unsecured with No Risk

 

criteria for calculated dimension :

If stage is 1 then Calculated dimension is Cancelled
If stage is (2 or 4) and Risk should be empty then Calculated dimension is Secured
if stage is (5 or 7) and Risk is Blank then Calculated dimension is unsecured with No Risk
if stage is (5 or 7) and Risk is Not Blank then Calculated dimension is unsecured with Risk

 

Based on the calculated dimension we need to display color in the bar charts please find the below color 

Completed --Green
Secured --Light Green
Unsecured with Risk --Red
Unsecured with No Risk--Orange
Cancelled--Black

 

Please let me know how can we give these colors to to the calculated dimension.

 

Thanks,

Chetan

3 Replies
Kushal_Chawda

@kumar2  what is the calculated dimension expression?

kumar2
Contributor III
Contributor III
Author

@Kushal_Chawda 

if(Stage=1,'Cancelled',
if(wildmatch(Stage,'2','4') and len(Risk)=0,'Secured',
if(wildmatch(Stage,'5','7') and len(Risk)=0,'Unsecured wth No Risk',
if(wildmatch(Stage,'5','7') and len(Risk)<>0,'Unsecured with Risk'))))

Kushal_Chawda

@kumar2  Go to the below settings of bar chart

Screenshot 2020-10-18 163717.png

Use below expression

f(Stage=1,black(),
if(wildmatch(Stage,'2','4') and len(Risk)=0,lightgreen(),
if(wildmatch(Stage,'5','7') and len(Risk)=0,orange(),
if(wildmatch(Stage,'5','7') and len(Risk)<>0,red()))))